BLE_API_Tiny_BLE

Dependents:   CSSE4011_BLE_IMU

Fork of BLE_API by Bluetooth Low Energy

Committer:
Rohit Grover
Date:
Wed Jul 23 15:09:23 2014 +0100
Revision:
106:a20be740075d
Child:
116:ca826083980e
initial re-organization of BLE_API directory structure

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rohit Grover 106:a20be740075d 1 /* mbed Microcontroller Library
Rohit Grover 106:a20be740075d 2 * Copyright (c) 2006-2013 ARM Limited
Rohit Grover 106:a20be740075d 3 *
Rohit Grover 106:a20be740075d 4 * Licensed under the Apache License, Version 2.0 (the "License");
Rohit Grover 106:a20be740075d 5 * you may not use this file except in compliance with the License.
Rohit Grover 106:a20be740075d 6 * You may obtain a copy of the License at
Rohit Grover 106:a20be740075d 7 *
Rohit Grover 106:a20be740075d 8 * http://www.apache.org/licenses/LICENSE-2.0
Rohit Grover 106:a20be740075d 9 *
Rohit Grover 106:a20be740075d 10 * Unless required by applicable law or agreed to in writing, software
Rohit Grover 106:a20be740075d 11 * distributed under the License is distributed on an "AS IS" BASIS,
Rohit Grover 106:a20be740075d 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Rohit Grover 106:a20be740075d 13 * See the License for the specific language governing permissions and
Rohit Grover 106:a20be740075d 14 * limitations under the License.
Rohit Grover 106:a20be740075d 15 */
Rohit Grover 106:a20be740075d 16
Rohit Grover 106:a20be740075d 17 #ifndef __GATT_SERVER_EVENTS_H__
Rohit Grover 106:a20be740075d 18 #define __GATT_SERVER_EVENTS_H__
Rohit Grover 106:a20be740075d 19
Rohit Grover 106:a20be740075d 20 #include "blecommon.h"
Rohit Grover 106:a20be740075d 21 #include "mbed.h"
Rohit Grover 106:a20be740075d 22
Rohit Grover 106:a20be740075d 23 /**************************************************************************/
Rohit Grover 106:a20be740075d 24 /*!
Rohit Grover 106:a20be740075d 25 \brief
Rohit Grover 106:a20be740075d 26 The base class used to abstract away the callback events that can be
Rohit Grover 106:a20be740075d 27 triggered with the GATT Server.
Rohit Grover 106:a20be740075d 28 */
Rohit Grover 106:a20be740075d 29 /**************************************************************************/
Rohit Grover 106:a20be740075d 30 class GattServerEvents
Rohit Grover 106:a20be740075d 31 {
Rohit Grover 106:a20be740075d 32 public:
Rohit Grover 106:a20be740075d 33 /******************************************************************/
Rohit Grover 106:a20be740075d 34 /*!
Rohit Grover 106:a20be740075d 35 \brief
Rohit Grover 106:a20be740075d 36 Identifies GATT events generated by the radio HW when an event
Rohit Grover 106:a20be740075d 37 callback occurs
Rohit Grover 106:a20be740075d 38 */
Rohit Grover 106:a20be740075d 39 /******************************************************************/
Rohit Grover 106:a20be740075d 40 typedef enum gattEvent_e {
Rohit Grover 106:a20be740075d 41 GATT_EVENT_DATA_SENT = 1, /**< Fired when a msg was successfully sent out (notify only?) */
Rohit Grover 106:a20be740075d 42 GATT_EVENT_DATA_WRITTEN = 2, /**< Client wrote data to Server (separate into char and descriptor writes?) */
Rohit Grover 106:a20be740075d 43 GATT_EVENT_UPDATES_ENABLED = 3, /**< Notify/Indicate Enabled in CCCD */
Rohit Grover 106:a20be740075d 44 GATT_EVENT_UPDATES_DISABLED = 4, /**< Notify/Indicate Disabled in CCCD */
Rohit Grover 106:a20be740075d 45 GATT_EVENT_CONFIRMATION_RECEIVED = 5 /**< Response received from Indicate message */
Rohit Grover 106:a20be740075d 46 } gattEvent_t;
Rohit Grover 106:a20be740075d 47
Rohit Grover 106:a20be740075d 48 /******************************************************************/
Rohit Grover 106:a20be740075d 49 /*!
Rohit Grover 106:a20be740075d 50 \brief
Rohit Grover 106:a20be740075d 51 A message was successfully transmitted
Rohit Grover 106:a20be740075d 52 */
Rohit Grover 106:a20be740075d 53 /******************************************************************/
Rohit Grover 106:a20be740075d 54 virtual void onDataSent(uint16_t charHandle) {
Rohit Grover 106:a20be740075d 55 }
Rohit Grover 106:a20be740075d 56
Rohit Grover 106:a20be740075d 57 /******************************************************************/
Rohit Grover 106:a20be740075d 58 /*!
Rohit Grover 106:a20be740075d 59 \brief
Rohit Grover 106:a20be740075d 60 The GATT client (the phone, tablet, etc.) wrote data to a
Rohit Grover 106:a20be740075d 61 characteristic or descriptor on the GATT Server (the peripheral
Rohit Grover 106:a20be740075d 62 device).
Rohit Grover 106:a20be740075d 63 */
Rohit Grover 106:a20be740075d 64 /******************************************************************/
Rohit Grover 106:a20be740075d 65 virtual void onDataWritten(uint16_t charHandle) {
Rohit Grover 106:a20be740075d 66 }
Rohit Grover 106:a20be740075d 67
Rohit Grover 106:a20be740075d 68 /******************************************************************/
Rohit Grover 106:a20be740075d 69 /*!
Rohit Grover 106:a20be740075d 70 \brief
Rohit Grover 106:a20be740075d 71 A Notify or Indicate flag was enabled in the CCCD
Rohit Grover 106:a20be740075d 72 */
Rohit Grover 106:a20be740075d 73 /******************************************************************/
Rohit Grover 106:a20be740075d 74 virtual void onUpdatesEnabled(uint16_t charHandle) {
Rohit Grover 106:a20be740075d 75 }
Rohit Grover 106:a20be740075d 76
Rohit Grover 106:a20be740075d 77 /******************************************************************/
Rohit Grover 106:a20be740075d 78 /*!
Rohit Grover 106:a20be740075d 79 \brief
Rohit Grover 106:a20be740075d 80 A Notify or Indicate flag was disabled in the CCCD
Rohit Grover 106:a20be740075d 81 */
Rohit Grover 106:a20be740075d 82 /******************************************************************/
Rohit Grover 106:a20be740075d 83 virtual void onUpdatesDisabled(uint16_t charHandle) {
Rohit Grover 106:a20be740075d 84 }
Rohit Grover 106:a20be740075d 85
Rohit Grover 106:a20be740075d 86 /******************************************************************/
Rohit Grover 106:a20be740075d 87 /*!
Rohit Grover 106:a20be740075d 88 \brief
Rohit Grover 106:a20be740075d 89 A confirmation response was received from an Indicate message
Rohit Grover 106:a20be740075d 90 */
Rohit Grover 106:a20be740075d 91 /******************************************************************/
Rohit Grover 106:a20be740075d 92 virtual void onConfirmationReceived(uint16_t charHandle) {
Rohit Grover 106:a20be740075d 93 }
Rohit Grover 106:a20be740075d 94 };
Rohit Grover 106:a20be740075d 95
Rohit Grover 106:a20be740075d 96 #endif // ifndef __GATT_SERVER_EVENTS_H__