Added an EddystoneURLConfigService in addition to UriBeaconConfigService. Updated README and converted comments that used UriBeacon to EddystoneURL in the EddystoneService.h

Dependents:   mbed_EddystoneURL_Beacon_ssci mbed_EddystoneURL_Beacon_ssci mbed_EddystoneURL_Beacon_ssci

Fork of BLE_API by Bluetooth Low Energy

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers GattCallbackParamTypes.h Source File

GattCallbackParamTypes.h

00001 /* mbed Microcontroller Library
00002  * Copyright (c) 2006-2013 ARM Limited
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef __GATT_CALLBACK_PARAM_TYPES_H__
00018 #define __GATT_CALLBACK_PARAM_TYPES_H__
00019 
00020 struct GattWriteCallbackParams {
00021     enum WriteOp_t {
00022         OP_INVALID               = 0x00,  /**< Invalid Operation. */
00023         OP_WRITE_REQ             = 0x01,  /**< Write Request. */
00024         OP_WRITE_CMD             = 0x02,  /**< Write Command. */
00025         OP_SIGN_WRITE_CMD        = 0x03,  /**< Signed Write Command. */
00026         OP_PREP_WRITE_REQ        = 0x04,  /**< Prepare Write Request. */
00027         OP_EXEC_WRITE_REQ_CANCEL = 0x05,  /**< Execute Write Request: Cancel all prepared writes. */
00028         OP_EXEC_WRITE_REQ_NOW    = 0x06,  /**< Execute Write Request: Immediately execute all prepared writes. */
00029     };
00030 
00031     Gap::Handle_t            connHandle;
00032     GattAttribute::Handle_t  handle;
00033     WriteOp_t                writeOp; /**< Type of write operation, */
00034     uint16_t                 offset;  /**< Offset for the write operation. */
00035     uint16_t                 len;
00036     const uint8_t           *data;    /* @note: data might not persist beyond the callback; make a local copy if needed. */
00037 };
00038 
00039 struct GattReadCallbackParams {
00040     Gap::Handle_t            connHandle;
00041     GattAttribute::Handle_t  handle;
00042     uint16_t                 offset;  /**< Offset for the read operation. */
00043     uint16_t                 len;
00044     const uint8_t           *data;    /* @note: data might not persist beyond the callback; make a local copy if needed. */
00045 };
00046 
00047 enum GattAuthCallbackReply_t {
00048     AUTH_CALLBACK_REPLY_SUCCESS                       = 0x00,    /**< Success. */
00049     AUTH_CALLBACK_REPLY_ATTERR_INVALID_HANDLE         = 0x0101,  /**< ATT Error: Invalid Attribute Handle. */
00050     AUTH_CALLBACK_REPLY_ATTERR_READ_NOT_PERMITTED     = 0x0102,  /**< ATT Error: Read not permitted. */
00051     AUTH_CALLBACK_REPLY_ATTERR_WRITE_NOT_PERMITTED    = 0x0103,  /**< ATT Error: Write not permitted. */
00052     AUTH_CALLBACK_REPLY_ATTERR_INSUF_AUTHENTICATION   = 0x0105,  /**< ATT Error: Authenticated link required. */
00053     AUTH_CALLBACK_REPLY_ATTERR_INVALID_OFFSET         = 0x0107,  /**< ATT Error: Offset specified was past the end of the attribute. */
00054     AUTH_CALLBACK_REPLY_ATTERR_INSUF_AUTHORIZATION    = 0x0108,  /**< ATT Error: Used in ATT as Insufficient Authorisation. */
00055     AUTH_CALLBACK_REPLY_ATTERR_PREPARE_QUEUE_FULL     = 0x0109,  /**< ATT Error: Used in ATT as Prepare Queue Full. */
00056     AUTH_CALLBACK_REPLY_ATTERR_ATTRIBUTE_NOT_FOUND    = 0x010A,  /**< ATT Error: Used in ATT as Attribute not found. */
00057     AUTH_CALLBACK_REPLY_ATTERR_ATTRIBUTE_NOT_LONG     = 0x010B,  /**< ATT Error: Attribute cannot be read or written using read/write blob requests. */
00058     AUTH_CALLBACK_REPLY_ATTERR_INVALID_ATT_VAL_LENGTH = 0x010D,  /**< ATT Error: Invalid value size. */
00059     AUTH_CALLBACK_REPLY_ATTERR_INSUF_RESOURCES        = 0x0111,  /**< ATT Error: Encrypted link required. */
00060 };
00061 
00062 struct GattWriteAuthCallbackParams {
00063     Gap::Handle_t            connHandle;
00064     GattAttribute::Handle_t  handle;
00065     uint16_t                 offset; /**< Offset for the write operation. */
00066     uint16_t                 len;    /**< Length of the incoming data. */
00067     const uint8_t           *data;   /**< Incoming data, variable length. */
00068     GattAuthCallbackReply_t  authorizationReply; /* This is the out parameter which needs to be set to true by the callback if the
00069                                                   * request is to proceed; false otherwise. */
00070 };
00071 
00072 struct GattReadAuthCallbackParams {
00073     Gap::Handle_t            connHandle;
00074     GattAttribute::Handle_t  handle;
00075     uint16_t                 offset; /**< Offset for the read operation. */
00076     uint16_t                 len;    /**< Optional: new length of the outgoing data. */
00077     uint8_t                 *data;   /**< Optional: new outgoing data. Leave at NULL if data is unchanged. */
00078     GattAuthCallbackReply_t  authorizationReply; /* This is the out parameter which needs to be set to true by the callback if the
00079                                                   * request is to proceed; false otherwise. */
00080 };
00081 
00082 /* For encapsulating handle-value update events (notifications or indications) generated at the remote server. */
00083 struct GattHVXCallbackParams {
00084   Gap::Handle_t            connHandle;
00085   GattAttribute::Handle_t  handle; /**< Attribute Handle to which the HVx operation applies. */
00086   HVXType_t                type;   /**< Indication or Notification, see @ref HVXType_t. */
00087   uint16_t                 len;    /**< Attribute data length. */
00088   const uint8_t           *data;   /**< Attribute data, variable length. */
00089 };
00090 
00091 #endif /*__GATT_CALLBACK_PARAM_TYPES_H__*/