YUFEI JIANG / BLE_API_Tiny_BLE

Dependents:   CSSE4011_BLE_IMU

Fork of BLE_API by Bluetooth Low Energy

Committer:
ktownsend
Date:
Tue Dec 10 07:32:12 2013 +0000
Revision:
2:ffc5216bd2cc
Child:
4:50a31ff5f974
UART Tests

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ktownsend 2:ffc5216bd2cc 1 #ifndef __GATT_CHARACTERISTIC_H__
ktownsend 2:ffc5216bd2cc 2 #define __GATT_CHARACTERISTIC_H__
ktownsend 2:ffc5216bd2cc 3
ktownsend 2:ffc5216bd2cc 4 #include "blecommon.h"
ktownsend 2:ffc5216bd2cc 5 #include "uuid.h"
ktownsend 2:ffc5216bd2cc 6
ktownsend 2:ffc5216bd2cc 7 class GattCharacteristic
ktownsend 2:ffc5216bd2cc 8 {
ktownsend 2:ffc5216bd2cc 9 private:
ktownsend 2:ffc5216bd2cc 10
ktownsend 2:ffc5216bd2cc 11 public:
ktownsend 2:ffc5216bd2cc 12 GattCharacteristic(uint16_t uuid, uint16_t minLen, uint16_t maxLen, uint8_t properties);
ktownsend 2:ffc5216bd2cc 13 virtual ~GattCharacteristic(void);
ktownsend 2:ffc5216bd2cc 14
ktownsend 2:ffc5216bd2cc 15 uint16_t uuid; /* Characteristic UUID */
ktownsend 2:ffc5216bd2cc 16 uint16_t lenMin; /* Minimum length of the value */
ktownsend 2:ffc5216bd2cc 17 uint16_t lenMax; /* Maximum length of the value */
ktownsend 2:ffc5216bd2cc 18 uint8_t index;
ktownsend 2:ffc5216bd2cc 19
ktownsend 2:ffc5216bd2cc 20 struct Properties
ktownsend 2:ffc5216bd2cc 21 {
ktownsend 2:ffc5216bd2cc 22 /* Standard properties */
ktownsend 2:ffc5216bd2cc 23 uint8_t broadcast :1; /**< Broadcasting of value permitted. */
ktownsend 2:ffc5216bd2cc 24 uint8_t read :1; /**< Reading value permitted. */
ktownsend 2:ffc5216bd2cc 25 uint8_t write_wo_resp :1; /**< Writing value with Write Command permitted. */
ktownsend 2:ffc5216bd2cc 26 uint8_t write :1; /**< Writing value with Write Request permitted. */
ktownsend 2:ffc5216bd2cc 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 2:ffc5216bd2cc 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 2:ffc5216bd2cc 29 uint8_t auth_signed_wr :1; /**< Writing value with Signed Write Command permitted. */
ktownsend 2:ffc5216bd2cc 30 } properties;
ktownsend 2:ffc5216bd2cc 31 };
ktownsend 2:ffc5216bd2cc 32
ktownsend 2:ffc5216bd2cc 33 #endif