最新revisionだとなんかerrorになるので、暫定的に rev 111にrevert。ごめんなさい。こういうときどういうふうにcommitすればいいのか分からなかったので。

Dependents:   MiniSteer_BLE

Fork of BLE_API by Bluetooth Low Energy

Embed: (wiki syntax)

« Back to documentation index

GattCharacteristic Class Reference

GattCharacteristic Class Reference

GATT characteristic. More...

#include <GattCharacteristic.h>

Data Structures

struct  PresentationFormat
 GATT presentation format wrapper. More...

Public Types

enum  ble_gatt_unit_e {
  BLE_GATT_UNIT_NONE = 0x2700, BLE_GATT_UNIT_LENGTH_METRE = 0x2701, BLE_GATT_UNIT_MASS_KILOGRAM = 0x2702, BLE_GATT_UNIT_TIME_SECOND = 0x2703,
  BLE_GATT_UNIT_ELECTRIC_CURRENT_AMPERE = 0x2704, BLE_GATT_UNIT_THERMODYNAMIC_TEMPERATURE_KELVIN = 0x2705, BLE_GATT_UNIT_AMOUNT_OF_SUBSTANCE_MOLE = 0x2706, BLE_GATT_UNIT_LUMINOUS_INTENSITY_CANDELA = 0x2707,
  BLE_GATT_UNIT_AREA_SQUARE_METRES = 0x2710, BLE_GATT_UNIT_VOLUME_CUBIC_METRES = 0x2711, BLE_GATT_UNIT_VELOCITY_METRES_PER_SECOND = 0x2712, BLE_GATT_UNIT_ACCELERATION_METRES_PER_SECOND_SQUARED = 0x2713,
  BLE_GATT_UNIT_WAVENUMBER_RECIPROCAL_METRE = 0x2714, BLE_GATT_UNIT_DENSITY_KILOGRAM_PER_CUBIC_METRE = 0x2715 , BLE_GATT_UNIT_MAGNETIC_FIELD_STRENGTH_AMPERE_PER_METRE = 0x2719 , BLE_GATT_UNIT_FREQUENCY_HERTZ = 0x2722,
  BLE_GATT_UNIT_FORCE_NEWTON = 0x2723, BLE_GATT_UNIT_PRESSURE_PASCAL = 0x2724, BLE_GATT_UNIT_ENERGY_JOULE = 0x2725, BLE_GATT_UNIT_POWER_WATT = 0x2726,
  BLE_GATT_UNIT_ELECTRIC_CHARGE_COULOMB = 0x2727, BLE_GATT_UNIT_ELECTRIC_POTENTIAL_DIFFERENCE_VOLT = 0x2728 , BLE_GATT_UNIT_TIME_MINUTE = 0x2760, BLE_GATT_UNIT_TIME_HOUR = 0x2761,
  BLE_GATT_UNIT_TIME_DAY = 0x2762 , BLE_GATT_UNIT_PRESSURE_BAR = 0x2780, BLE_GATT_UNIT_PRESSURE_MILLIMETRE_OF_MERCURY = 0x2781 , BLE_GATT_UNIT_LENGTH_YARD = 0x27A0,
  BLE_GATT_UNIT_LENGTH_PARSEC = 0x27A1, BLE_GATT_UNIT_LENGTH_INCH = 0x27A2, BLE_GATT_UNIT_LENGTH_FOOT = 0x27A3, BLE_GATT_UNIT_LENGTH_MILE = 0x27A4 ,
  BLE_GATT_UNIT_VELOCITY_KILOMETRE_PER_HOUR = 0x27A6, BLE_GATT_UNIT_VELOCITY_MILE_PER_HOUR = 0x27A7, BLE_GATT_UNIT_ANGULAR_VELOCITY_REVOLUTION_PER_MINUTE = 0x27A8, BLE_GATT_UNIT_ENERGY_GRAM_CALORIE = 0x27A9,
  BLE_GATT_UNIT_ENERGY_KILOGRAM_CALORIE = 0x27AA, BLE_GATT_UNIT_ENERGY_KILOWATT_HOUR = 0x27AB , BLE_GATT_UNIT_PERCENTAGE = 0x27AD , BLE_GATT_UNIT_TIME_YEAR = 0x27B3,
  BLE_GATT_UNIT_TIME_MONTH = 0x27B4
}
 

Standard GATT characteristic presentation format unit types. These unit types are used to decribe what the raw numeric data in a characteristic actually represents.

More...
enum  ble_gatt_format_e {
  BLE_GATT_FORMAT_RFU = 0x00, BLE_GATT_FORMAT_BOOLEAN = 0x01, BLE_GATT_FORMAT_2BIT = 0x02, BLE_GATT_FORMAT_NIBBLE = 0x03,
  BLE_GATT_FORMAT_UINT8 = 0x04, BLE_GATT_FORMAT_UINT12 = 0x05, BLE_GATT_FORMAT_UINT16 = 0x06, BLE_GATT_FORMAT_UINT24 = 0x07,
  BLE_GATT_FORMAT_UINT32 = 0x08, BLE_GATT_FORMAT_UINT48 = 0x09, BLE_GATT_FORMAT_UINT64 = 0x0A, BLE_GATT_FORMAT_UINT128 = 0x0B,
  BLE_GATT_FORMAT_SINT8 = 0x0C, BLE_GATT_FORMAT_SINT12 = 0x0D, BLE_GATT_FORMAT_SINT16 = 0x0E, BLE_GATT_FORMAT_SINT24 = 0x0F,
  BLE_GATT_FORMAT_SINT32 = 0x10, BLE_GATT_FORMAT_SINT48 = 0x11, BLE_GATT_FORMAT_SINT64 = 0x12, BLE_GATT_FORMAT_SINT128 = 0x13,
  BLE_GATT_FORMAT_FLOAT32 = 0x14, BLE_GATT_FORMAT_FLOAT64 = 0x15, BLE_GATT_FORMAT_SFLOAT = 0x16, BLE_GATT_FORMAT_FLOAT = 0x17,
  BLE_GATT_FORMAT_DUINT16 = 0x18, BLE_GATT_FORMAT_UTF8S = 0x19, BLE_GATT_FORMAT_UTF16S = 0x1A, BLE_GATT_FORMAT_STRUCT = 0x1B
}
 

Standard GATT number types.

More...
enum  ble_gatt_char_properties_e { ,
  BLE_GATT_CHAR_PROPERTIES_BROADCAST = 0x01, BLE_GATT_CHAR_PROPERTIES_READ = 0x02, BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE = 0x04, BLE_GATT_CHAR_PROPERTIES_WRITE = 0x08,
  BLE_GATT_CHAR_PROPERTIES_NOTIFY = 0x10, BLE_GATT_CHAR_PROPERTIES_INDICATE = 0x20, BLE_GATT_CHAR_PROPERTIES_AUTHENTICATED_SIGNED_WRITES = 0x40, BLE_GATT_CHAR_PROPERTIES_EXTENDED_PROPERTIES = 0x80
}
 

Standard GATT characteritic properties.

More...
typedef enum
GattCharacteristic::ble_gatt_unit_e 
ble_gatt_unit_t
 Standard GATT characteristic presentation format unit types. These unit types are used to decribe what the raw numeric data in a characteristic actually represents.
typedef enum
GattCharacteristic::ble_gatt_format_e 
ble_gatt_format_t
 Standard GATT number types.
typedef enum
GattCharacteristic::ble_gatt_char_properties_e 
ble_gatt_char_properties_t
 Standard GATT characteritic properties.
typedef struct
GattCharacteristic::PresentationFormat 
presentation_format_t
 GATT presentation format wrapper.

Public Member Functions

 GattCharacteristic (const UUID &uuid, uint8_t *valuePtr=NULL, uint16_t initialLen=0, uint16_t maxLen=0, uint8_t props=BLE_GATT_CHAR_PROPERTIES_NONE)
 Creates a new GattCharacteristic using the specified 16-bit UUID, value length, and properties.

Detailed Description

GATT characteristic.

Definition at line 29 of file GattCharacteristic.h.


Member Typedef Documentation

Standard GATT characteritic properties.

Note:
See Bluetooth Specification 4.0 (Vol. 3), Part G, Section 3.3.1.1 and Section 3.3.3.1 for Extended Properties

Standard GATT characteristic presentation format unit types. These unit types are used to decribe what the raw numeric data in a characteristic actually represents.

Note:
See https://developer.bluetooth.org/gatt/units/Pages/default.aspx

Member Enumeration Documentation

Standard GATT characteritic properties.

Note:
See Bluetooth Specification 4.0 (Vol. 3), Part G, Section 3.3.1.1 and Section 3.3.3.1 for Extended Properties
Enumerator:
BLE_GATT_CHAR_PROPERTIES_BROADCAST 

Permits broadcasts of the Characteristic Value using Server Characteristic Configuration Descriptor.

BLE_GATT_CHAR_PROPERTIES_READ 

Permits reads of the Characteristic Value.

BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE 

Permits writes of the Characteristic Value without response.

BLE_GATT_CHAR_PROPERTIES_WRITE 

Permits writes of the Characteristic Value with response.

BLE_GATT_CHAR_PROPERTIES_NOTIFY 

Permits notifications of a Characteristic Value without acknowledgement.

BLE_GATT_CHAR_PROPERTIES_INDICATE 

Permits indications of a Characteristic Value with acknowledgement.

BLE_GATT_CHAR_PROPERTIES_AUTHENTICATED_SIGNED_WRITES 

Permits signed writes to the Characteristic Value.

BLE_GATT_CHAR_PROPERTIES_EXTENDED_PROPERTIES 

Additional characteristic properties are defined in the Characteristic Extended Properties Descriptor.

Definition at line 271 of file GattCharacteristic.h.

Standard GATT number types.

Note:
See Bluetooth Specification 4.0 (Vol. 3), Part G, Section 3.3.3.5.2
See http://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml
Enumerator:
BLE_GATT_FORMAT_RFU 

Reserved For Future Use.

BLE_GATT_FORMAT_BOOLEAN 

Boolean.

BLE_GATT_FORMAT_2BIT 

Unsigned 2-bit integer.

BLE_GATT_FORMAT_NIBBLE 

Unsigned 4-bit integer.

BLE_GATT_FORMAT_UINT8 

Unsigned 8-bit integer.

BLE_GATT_FORMAT_UINT12 

Unsigned 12-bit integer.

BLE_GATT_FORMAT_UINT16 

Unsigned 16-bit integer.

BLE_GATT_FORMAT_UINT24 

Unsigned 24-bit integer.

BLE_GATT_FORMAT_UINT32 

Unsigned 32-bit integer.

BLE_GATT_FORMAT_UINT48 

Unsigned 48-bit integer.

BLE_GATT_FORMAT_UINT64 

Unsigned 64-bit integer.

BLE_GATT_FORMAT_UINT128 

Unsigned 128-bit integer.

BLE_GATT_FORMAT_SINT8 

Signed 2-bit integer.

BLE_GATT_FORMAT_SINT12 

Signed 12-bit integer.

BLE_GATT_FORMAT_SINT16 

Signed 16-bit integer.

BLE_GATT_FORMAT_SINT24 

Signed 24-bit integer.

BLE_GATT_FORMAT_SINT32 

Signed 32-bit integer.

BLE_GATT_FORMAT_SINT48 

Signed 48-bit integer.

BLE_GATT_FORMAT_SINT64 

Signed 64-bit integer.

BLE_GATT_FORMAT_SINT128 

Signed 128-bit integer.

BLE_GATT_FORMAT_FLOAT32 

IEEE-754 32-bit floating point.

BLE_GATT_FORMAT_FLOAT64 

IEEE-754 64-bit floating point.

BLE_GATT_FORMAT_SFLOAT 

IEEE-11073 16-bit SFLOAT.

BLE_GATT_FORMAT_FLOAT 

IEEE-11073 32-bit FLOAT.

BLE_GATT_FORMAT_DUINT16 

IEEE-20601 format.

BLE_GATT_FORMAT_UTF8S 

UTF-8 string.

BLE_GATT_FORMAT_UTF16S 

UTF-16 string.

BLE_GATT_FORMAT_STRUCT 

Opaque Structure.

Definition at line 232 of file GattCharacteristic.h.

Standard GATT characteristic presentation format unit types. These unit types are used to decribe what the raw numeric data in a characteristic actually represents.

Note:
See https://developer.bluetooth.org/gatt/units/Pages/default.aspx
Enumerator:
BLE_GATT_UNIT_NONE 

No specified unit type.

BLE_GATT_UNIT_LENGTH_METRE 

Length, Metre.

BLE_GATT_UNIT_MASS_KILOGRAM 

Mass, Kilogram.

BLE_GATT_UNIT_TIME_SECOND 

Time, Second.

BLE_GATT_UNIT_ELECTRIC_CURRENT_AMPERE 

Electric Current, Ampere.

BLE_GATT_UNIT_THERMODYNAMIC_TEMPERATURE_KELVIN 

Thermodynamic Temperature, Kelvin.

BLE_GATT_UNIT_AMOUNT_OF_SUBSTANCE_MOLE 

Amount of Substance, Mole.

BLE_GATT_UNIT_LUMINOUS_INTENSITY_CANDELA 

Luminous Intensity, Candela.

BLE_GATT_UNIT_AREA_SQUARE_METRES 

Area, Square Metres.

BLE_GATT_UNIT_VOLUME_CUBIC_METRES 

Volume, Cubic Metres.

BLE_GATT_UNIT_VELOCITY_METRES_PER_SECOND 

Velocity, Metres per Second.

BLE_GATT_UNIT_ACCELERATION_METRES_PER_SECOND_SQUARED 

Acceleration, Metres per Second Squared.

BLE_GATT_UNIT_WAVENUMBER_RECIPROCAL_METRE 

Wave Number Reciprocal, Metre.

BLE_GATT_UNIT_DENSITY_KILOGRAM_PER_CUBIC_METRE 

Density, Kilogram per Cubic Metre.

BLE_GATT_UNIT_MAGNETIC_FIELD_STRENGTH_AMPERE_PER_METRE 

Magnetic Field Strength, Ampere per Metre.

BLE_GATT_UNIT_FREQUENCY_HERTZ 

Frequency, Hertz.

BLE_GATT_UNIT_FORCE_NEWTON 

Force, Newton.

BLE_GATT_UNIT_PRESSURE_PASCAL 

Pressure, Pascal.

BLE_GATT_UNIT_ENERGY_JOULE 

Energy, Joule.

BLE_GATT_UNIT_POWER_WATT 

Power, Watt.

BLE_GATT_UNIT_ELECTRIC_CHARGE_COULOMB 

Electrical Charge, Coulomb.

BLE_GATT_UNIT_ELECTRIC_POTENTIAL_DIFFERENCE_VOLT 

Electrical Potential Difference, Voltage.

BLE_GATT_UNIT_TIME_MINUTE 

Time, Minute.

BLE_GATT_UNIT_TIME_HOUR 

Time, Hour.

BLE_GATT_UNIT_TIME_DAY 

Time, Day.

BLE_GATT_UNIT_PRESSURE_BAR 

Pressure, Bar.

BLE_GATT_UNIT_PRESSURE_MILLIMETRE_OF_MERCURY 

Pressure, Millimetre of Mercury.

BLE_GATT_UNIT_LENGTH_YARD 

Length, Yard.

BLE_GATT_UNIT_LENGTH_PARSEC 

Length, Parsec.

BLE_GATT_UNIT_LENGTH_INCH 

Length, Inch.

BLE_GATT_UNIT_LENGTH_FOOT 

Length, Foot.

BLE_GATT_UNIT_LENGTH_MILE 

Length, Mile.

BLE_GATT_UNIT_VELOCITY_KILOMETRE_PER_HOUR 

Velocity, Kilometre per Hour.

BLE_GATT_UNIT_VELOCITY_MILE_PER_HOUR 

Velocity, Mile per Hour.

BLE_GATT_UNIT_ANGULAR_VELOCITY_REVOLUTION_PER_MINUTE 

Angular Velocity, Revolution per Minute.

BLE_GATT_UNIT_ENERGY_GRAM_CALORIE 

Energy, Gram Calorie.

BLE_GATT_UNIT_ENERGY_KILOGRAM_CALORIE 

Energy, Kilogram Calorie.

BLE_GATT_UNIT_ENERGY_KILOWATT_HOUR 

Energy, Killowatt Hour.

BLE_GATT_UNIT_PERCENTAGE 

Percentage.

BLE_GATT_UNIT_TIME_YEAR 

Time, Year.

BLE_GATT_UNIT_TIME_MONTH 

Time, Month.

Definition at line 112 of file GattCharacteristic.h.


Constructor & Destructor Documentation

GattCharacteristic ( const UUID &  uuid,
uint8_t *  valuePtr = NULL,
uint16_t  initialLen = 0,
uint16_t  maxLen = 0,
uint8_t  props = BLE_GATT_CHAR_PROPERTIES_NONE 
)

Creates a new GattCharacteristic using the specified 16-bit UUID, value length, and properties.

Note:
The UUID value must be unique in the service and is normally >1
Parameters:
[in]uuidThe UUID to use for this characteristic
[in]valuePtrThe memory holding the initial value.
[in]initialLenThe min length in bytes of this characteristic's value
[in]maxLenThe max length in bytes of this characteristic's value
[in]propsThe 8-bit bit field containing the characteristic's properties

EXAMPLE

  // UUID = 0x2A19, Min length 2, Max len = 2, Properties = write
  GattCharacteristic c = GattCharacteristic( 0x2A19, 2, 2, BLE_GATT_CHAR_PROPERTIES_WRITE );

Definition at line 326 of file GattCharacteristic.h.