xiao sun / BLE_API

Fork of BLE_API by Bluetooth Low Energy

Committer:
bogdanm
Date:
Tue Apr 01 11:04:56 2014 +0100
Revision:
31:2c94f0501807
Child:
34:da2ea8cd6216
Synchronized with git revision fdcc1e387426ce216bc17175b73bcd5f4aececff

Who changed what in which revision?

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