Microbug / BLE_API

Fork of BLE_API by Bluetooth Low Energy

Committer:
ktownsend
Date:
Wed Dec 04 07:20:24 2013 +0000
Revision:
1:fd3ec64b2345
Parent:
0:ace2e8d3ce79
Added LPC1768 pinout

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ktownsend 0:ace2e8d3ce79 1 #ifndef __BLE_CHARACTERISTIC_H__
ktownsend 0:ace2e8d3ce79 2 #define __BLE_CHARACTERISTIC_H__
ktownsend 0:ace2e8d3ce79 3
ktownsend 0:ace2e8d3ce79 4 #include "blecommon.h"
ktownsend 0:ace2e8d3ce79 5 #include "uuid.h"
ktownsend 0:ace2e8d3ce79 6
ktownsend 0:ace2e8d3ce79 7 class BLECharacteristic
ktownsend 0:ace2e8d3ce79 8 {
ktownsend 0:ace2e8d3ce79 9 private:
ktownsend 0:ace2e8d3ce79 10
ktownsend 0:ace2e8d3ce79 11 public:
ktownsend 0:ace2e8d3ce79 12 BLECharacteristic(uint16_t uuid, uint16_t minLen, uint16_t maxLen, uint8_t properties);
ktownsend 0:ace2e8d3ce79 13 virtual ~BLECharacteristic(void);
ktownsend 0:ace2e8d3ce79 14
ktownsend 0:ace2e8d3ce79 15 uint16_t uuid; /* Characteristic UUID */
ktownsend 0:ace2e8d3ce79 16 uint16_t lenMin; /* Minimum length of the value */
ktownsend 0:ace2e8d3ce79 17 uint16_t lenMax; /* Maximum length of the value */
ktownsend 0:ace2e8d3ce79 18 uint8_t index;
ktownsend 0:ace2e8d3ce79 19
ktownsend 0:ace2e8d3ce79 20 struct Properties
ktownsend 0:ace2e8d3ce79 21 {
ktownsend 0:ace2e8d3ce79 22 /* Standard properties */
ktownsend 0:ace2e8d3ce79 23 uint8_t broadcast :1; /**< Broadcasting of value permitted. */
ktownsend 0:ace2e8d3ce79 24 uint8_t read :1; /**< Reading value permitted. */
ktownsend 0:ace2e8d3ce79 25 uint8_t write_wo_resp :1; /**< Writing value with Write Command permitted. */
ktownsend 0:ace2e8d3ce79 26 uint8_t write :1; /**< Writing value with Write Request permitted. */
ktownsend 0:ace2e8d3ce79 27 uint8_t notify :1; /**< Notications of value permitted. */ // https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml
ktownsend 0:ace2e8d3ce79 28 uint8_t indicate :1; /**< Indications of value permitted. */ // https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml
ktownsend 0:ace2e8d3ce79 29 uint8_t auth_signed_wr :1; /**< Writing value with Signed Write Command permitted. */
ktownsend 0:ace2e8d3ce79 30 } properties;
ktownsend 0:ace2e8d3ce79 31 };
ktownsend 0:ace2e8d3ce79 32
ktownsend 0:ace2e8d3ce79 33 #endif