Minor temporary patch to allow DFU packet callback
Fork of BLE_API by
hw/GattServerEvents.h@97:a412356d9f49, 2014-07-02 (annotated)
- Committer:
- Rohit Grover
- Date:
- Wed Jul 02 09:08:48 2014 +0100
- Revision:
- 97:a412356d9f49
- Parent:
- 77:1436ecf09583
undoing the negative effects of a previous use of 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 __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 | /**************************************************************************/ |
Rohit Grover |
77:1436ecf09583 | 30 | class GattServerEvents |
Rohit Grover |
77:1436ecf09583 | 31 | { |
Rohit Grover |
34:da2ea8cd6216 | 32 | public: |
Rohit Grover |
34:da2ea8cd6216 | 33 | /******************************************************************/ |
Rohit Grover |
34:da2ea8cd6216 | 34 | /*! |
Rohit Grover |
34:da2ea8cd6216 | 35 | \brief |
Rohit Grover |
34:da2ea8cd6216 | 36 | Identifies GATT events generated by the radio HW when an event |
Rohit Grover |
34:da2ea8cd6216 | 37 | callback occurs |
Rohit Grover |
34:da2ea8cd6216 | 38 | */ |
Rohit Grover |
34:da2ea8cd6216 | 39 | /******************************************************************/ |
Rohit Grover |
77:1436ecf09583 | 40 | typedef enum gattEvent_e { |
Rohit Grover |
97:a412356d9f49 | 41 | GATT_EVENT_DATA_SENT = 1, /**< Fired when a msg was successfully sent out (notify only?) */ |
Rohit Grover |
97:a412356d9f49 | 42 | GATT_EVENT_DATA_WRITTEN = 2, /**< Client wrote data to Server (separate into char and descriptor writes?) */ |
Rohit Grover |
97:a412356d9f49 | 43 | GATT_EVENT_UPDATES_ENABLED = 3, /**< Notify/Indicate Enabled in CCCD */ |
Rohit Grover |
97:a412356d9f49 | 44 | GATT_EVENT_UPDATES_DISABLED = 4, /**< Notify/Indicate Disabled in CCCD */ |
Rohit Grover |
97:a412356d9f49 | 45 | GATT_EVENT_CONFIRMATION_RECEIVED = 5 /**< Response received from Indicate message */ |
Rohit Grover |
34:da2ea8cd6216 | 46 | } gattEvent_t; |
bogdanm | 31:2c94f0501807 | 47 | |
Rohit Grover |
34:da2ea8cd6216 | 48 | /******************************************************************/ |
Rohit Grover |
34:da2ea8cd6216 | 49 | /*! |
Rohit Grover |
34:da2ea8cd6216 | 50 | \brief |
Rohit Grover |
34:da2ea8cd6216 | 51 | A message was successfully transmitted |
Rohit Grover |
34:da2ea8cd6216 | 52 | */ |
Rohit Grover |
34:da2ea8cd6216 | 53 | /******************************************************************/ |
Rohit Grover |
34:da2ea8cd6216 | 54 | virtual void onDataSent(uint16_t charHandle) { |
Rohit Grover |
34:da2ea8cd6216 | 55 | } |
bogdanm | 31:2c94f0501807 | 56 | |
Rohit Grover |
34:da2ea8cd6216 | 57 | /******************************************************************/ |
Rohit Grover |
34:da2ea8cd6216 | 58 | /*! |
Rohit Grover |
34:da2ea8cd6216 | 59 | \brief |
Rohit Grover |
34:da2ea8cd6216 | 60 | The GATT client (the phone, tablet, etc.) wrote data to a |
Rohit Grover |
34:da2ea8cd6216 | 61 | characteristic or descriptor on the GATT Server (the peripheral |
Rohit Grover |
34:da2ea8cd6216 | 62 | device). |
Rohit Grover |
34:da2ea8cd6216 | 63 | */ |
Rohit Grover |
34:da2ea8cd6216 | 64 | /******************************************************************/ |
Rohit Grover |
34:da2ea8cd6216 | 65 | virtual void onDataWritten(uint16_t charHandle) { |
Rohit Grover |
34:da2ea8cd6216 | 66 | } |
bogdanm | 31:2c94f0501807 | 67 | |
Rohit Grover |
34:da2ea8cd6216 | 68 | /******************************************************************/ |
Rohit Grover |
34:da2ea8cd6216 | 69 | /*! |
Rohit Grover |
34:da2ea8cd6216 | 70 | \brief |
Rohit Grover |
34:da2ea8cd6216 | 71 | A Notify or Indicate flag was enabled in the CCCD |
Rohit Grover |
34:da2ea8cd6216 | 72 | */ |
Rohit Grover |
34:da2ea8cd6216 | 73 | /******************************************************************/ |
Rohit Grover |
34:da2ea8cd6216 | 74 | virtual void onUpdatesEnabled(uint16_t charHandle) { |
Rohit Grover |
34:da2ea8cd6216 | 75 | } |
bogdanm | 31:2c94f0501807 | 76 | |
Rohit Grover |
34:da2ea8cd6216 | 77 | /******************************************************************/ |
Rohit Grover |
34:da2ea8cd6216 | 78 | /*! |
Rohit Grover |
34:da2ea8cd6216 | 79 | \brief |
Rohit Grover |
34:da2ea8cd6216 | 80 | A Notify or Indicate flag was disabled in the CCCD |
Rohit Grover |
34:da2ea8cd6216 | 81 | */ |
Rohit Grover |
34:da2ea8cd6216 | 82 | /******************************************************************/ |
Rohit Grover |
34:da2ea8cd6216 | 83 | virtual void onUpdatesDisabled(uint16_t charHandle) { |
Rohit Grover |
34:da2ea8cd6216 | 84 | } |
bogdanm | 31:2c94f0501807 | 85 | |
Rohit Grover |
34:da2ea8cd6216 | 86 | /******************************************************************/ |
Rohit Grover |
34:da2ea8cd6216 | 87 | /*! |
Rohit Grover |
34:da2ea8cd6216 | 88 | \brief |
Rohit Grover |
34:da2ea8cd6216 | 89 | A confirmation response was received from an Indicate message |
Rohit Grover |
34:da2ea8cd6216 | 90 | */ |
Rohit Grover |
34:da2ea8cd6216 | 91 | /******************************************************************/ |
Rohit Grover |
34:da2ea8cd6216 | 92 | virtual void onConfirmationReceived(uint16_t charHandle) { |
Rohit Grover |
34:da2ea8cd6216 | 93 | } |
bogdanm | 31:2c94f0501807 | 94 | }; |
bogdanm | 31:2c94f0501807 | 95 | |
Rohit Grover |
34:da2ea8cd6216 | 96 | #endif // ifndef __GATT_SERVER_EVENTS_H__ |