Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BLE_API by
hw/GapEvents.h@34:da2ea8cd6216, 2014-05-21 (annotated)
- Committer:
- Rohit Grover
- Date:
- Wed May 21 15:01:14 2014 +0100
- Revision:
- 34:da2ea8cd6216
- Parent:
- 31:2c94f0501807
- Child:
- 77:1436ecf09583
white space diffs; generated using uncrustify
Who changed what in which revision?
| User | Revision | Line number | New 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. |
| Rohit Grover |
34:da2ea8cd6216 | 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 { |
| Rohit Grover |
34:da2ea8cd6216 | 31 | public: |
| Rohit Grover |
34:da2ea8cd6216 | 32 | /******************************************************************/ |
| Rohit Grover |
34:da2ea8cd6216 | 33 | /*! |
| Rohit Grover |
34:da2ea8cd6216 | 34 | \brief |
| Rohit Grover |
34:da2ea8cd6216 | 35 | Identifies GAP events generated by the radio HW when an event |
| Rohit Grover |
34:da2ea8cd6216 | 36 | callback occurs |
| Rohit Grover |
34:da2ea8cd6216 | 37 | */ |
| Rohit Grover |
34:da2ea8cd6216 | 38 | /******************************************************************/ |
| Rohit Grover |
34:da2ea8cd6216 | 39 | typedef enum gapEvent_e |
| Rohit Grover |
34:da2ea8cd6216 | 40 | { |
| Rohit Grover |
34:da2ea8cd6216 | 41 | GAP_EVENT_TIMEOUT = 1, /**< Advertising timed out |
| Rohit Grover |
34:da2ea8cd6216 | 42 | *before a connection was |
| Rohit Grover |
34:da2ea8cd6216 | 43 | *established */ |
| Rohit Grover |
34:da2ea8cd6216 | 44 | GAP_EVENT_CONNECTED = 2, /**< A connection was |
| Rohit Grover |
34:da2ea8cd6216 | 45 | *established with a |
| Rohit Grover |
34:da2ea8cd6216 | 46 | *central device */ |
| Rohit Grover |
34:da2ea8cd6216 | 47 | GAP_EVENT_DISCONNECTED = 3 /**< A connection was |
| Rohit Grover |
34:da2ea8cd6216 | 48 | *closed or lost with a |
| Rohit Grover |
34:da2ea8cd6216 | 49 | *central device */ |
| Rohit Grover |
34:da2ea8cd6216 | 50 | } gapEvent_t; |
| bogdanm | 31:2c94f0501807 | 51 | |
| Rohit Grover |
34:da2ea8cd6216 | 52 | /******************************************************************/ |
| Rohit Grover |
34:da2ea8cd6216 | 53 | /*! |
| Rohit Grover |
34:da2ea8cd6216 | 54 | \brief |
| Rohit Grover |
34:da2ea8cd6216 | 55 | Advertising timed out before a connection was established |
| Rohit Grover |
34:da2ea8cd6216 | 56 | */ |
| Rohit Grover |
34:da2ea8cd6216 | 57 | /******************************************************************/ |
| Rohit Grover |
34:da2ea8cd6216 | 58 | virtual void onTimeout(void) { |
| Rohit Grover |
34:da2ea8cd6216 | 59 | } |
| bogdanm | 31:2c94f0501807 | 60 | |
| Rohit Grover |
34:da2ea8cd6216 | 61 | /******************************************************************/ |
| Rohit Grover |
34:da2ea8cd6216 | 62 | /*! |
| Rohit Grover |
34:da2ea8cd6216 | 63 | \brief |
| Rohit Grover |
34:da2ea8cd6216 | 64 | A connection was established with a central device |
| Rohit Grover |
34:da2ea8cd6216 | 65 | */ |
| Rohit Grover |
34:da2ea8cd6216 | 66 | /******************************************************************/ |
| Rohit Grover |
34:da2ea8cd6216 | 67 | virtual void onConnected(void) { |
| Rohit Grover |
34:da2ea8cd6216 | 68 | } |
| bogdanm | 31:2c94f0501807 | 69 | |
| Rohit Grover |
34:da2ea8cd6216 | 70 | /******************************************************************/ |
| Rohit Grover |
34:da2ea8cd6216 | 71 | /*! |
| Rohit Grover |
34:da2ea8cd6216 | 72 | \brief |
| Rohit Grover |
34:da2ea8cd6216 | 73 | A connection was closed or lost with a central device |
| Rohit Grover |
34:da2ea8cd6216 | 74 | */ |
| Rohit Grover |
34:da2ea8cd6216 | 75 | /******************************************************************/ |
| Rohit Grover |
34:da2ea8cd6216 | 76 | virtual void onDisconnected(void) { |
| Rohit Grover |
34:da2ea8cd6216 | 77 | } |
| bogdanm | 31:2c94f0501807 | 78 | }; |
| bogdanm | 31:2c94f0501807 | 79 | |
| Rohit Grover |
34:da2ea8cd6216 | 80 | #endif // ifndef __GAP_EVENTS_H__ |
