Bizan Nishimura / BLE_API

Dependents:   MiniSteer_BLE

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 __GAP_EVENTS_H__
bogdanm 31:2c94f0501807 18 #define __GAP_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 GAP.
bogdanm 31:2c94f0501807 28 */
bogdanm 31:2c94f0501807 29 /**************************************************************************/
bogdanm 31:2c94f0501807 30 class GapEvents {
bogdanm 31:2c94f0501807 31 public:
bogdanm 31:2c94f0501807 32 /******************************************************************/
bogdanm 31:2c94f0501807 33 /*!
bogdanm 31:2c94f0501807 34 \brief
bogdanm 31:2c94f0501807 35 Identifies GAP 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 gapEvent_e
bogdanm 31:2c94f0501807 40 {
bogdanm 31:2c94f0501807 41 GAP_EVENT_TIMEOUT = 1, /**< Advertising timed out before a connection was established */
bogdanm 31:2c94f0501807 42 GAP_EVENT_CONNECTED = 2, /**< A connection was established with a central device */
bogdanm 31:2c94f0501807 43 GAP_EVENT_DISCONNECTED = 3 /**< A connection was closed or lost with a central device */
bogdanm 31:2c94f0501807 44 } gapEvent_t;
bogdanm 31:2c94f0501807 45
bogdanm 31:2c94f0501807 46 /******************************************************************/
bogdanm 31:2c94f0501807 47 /*!
bogdanm 31:2c94f0501807 48 \brief
bogdanm 31:2c94f0501807 49 Advertising timed out before a connection was established
bogdanm 31:2c94f0501807 50 */
bogdanm 31:2c94f0501807 51 /******************************************************************/
bogdanm 31:2c94f0501807 52 virtual void onTimeout(void) {}
bogdanm 31:2c94f0501807 53
bogdanm 31:2c94f0501807 54 /******************************************************************/
bogdanm 31:2c94f0501807 55 /*!
bogdanm 31:2c94f0501807 56 \brief
bogdanm 31:2c94f0501807 57 A connection was established with a central device
bogdanm 31:2c94f0501807 58 */
bogdanm 31:2c94f0501807 59 /******************************************************************/
bogdanm 31:2c94f0501807 60 virtual void onConnected(void) {}
bogdanm 31:2c94f0501807 61
bogdanm 31:2c94f0501807 62 /******************************************************************/
bogdanm 31:2c94f0501807 63 /*!
bogdanm 31:2c94f0501807 64 \brief
bogdanm 31:2c94f0501807 65 A connection was closed or lost with a central device
bogdanm 31:2c94f0501807 66 */
bogdanm 31:2c94f0501807 67 /******************************************************************/
bogdanm 31:2c94f0501807 68 virtual void onDisconnected(void) {}
bogdanm 31:2c94f0501807 69 };
bogdanm 31:2c94f0501807 70
bogdanm 31:2c94f0501807 71 #endif