Move certain UUID related declarations within the UUID namespace.

This commit is contained in:
Rohit Grover 2015-06-08 09:47:28 +01:00
parent abb753428b
commit 77c592a9a9
3 changed files with 14 additions and 14 deletions

View File

@ -21,10 +21,6 @@
#include "blecommon.h"
const unsigned LENGTH_OF_LONG_UUID = 16;
typedef uint16_t ShortUUIDBytes_t;
typedef uint8_t LongUUIDBytes_t[LENGTH_OF_LONG_UUID];
class UUID {
public:
enum UUID_Type_t {
@ -32,6 +28,10 @@ public:
UUID_TYPE_LONG = 1 // Full 128-bit UUID
};
static const unsigned LENGTH_OF_LONG_UUID = 16;
typedef uint16_t ShortUUIDBytes_t;
typedef uint8_t LongUUIDBytes_t[LENGTH_OF_LONG_UUID];
public:
/**
* Creates a new 128-bit UUID

View File

@ -16,26 +16,26 @@
#include "UARTService.h"
const uint8_t UARTServiceBaseUUID[LENGTH_OF_LONG_UUID] = {
const uint8_t UARTServiceBaseUUID[UUID::LENGTH_OF_LONG_UUID] = {
0x6E, 0x40, 0x00, 0x00, 0xB5, 0xA3, 0xF3, 0x93,
0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E,
};
const uint16_t UARTServiceShortUUID = 0x0001;
const uint16_t UARTServiceTXCharacteristicShortUUID = 0x0002;
const uint16_t UARTServiceRXCharacteristicShortUUID = 0x0003;
const uint8_t UARTServiceUUID[LENGTH_OF_LONG_UUID] = {
const uint8_t UARTServiceUUID[UUID::LENGTH_OF_LONG_UUID] = {
0x6E, 0x40, (uint8_t)(UARTServiceShortUUID >> 8), (uint8_t)(UARTServiceShortUUID & 0xFF), 0xB5, 0xA3, 0xF3, 0x93,
0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E,
};
const uint8_t UARTServiceUUID_reversed[LENGTH_OF_LONG_UUID] = {
const uint8_t UARTServiceUUID_reversed[UUID::LENGTH_OF_LONG_UUID] = {
0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0,
0x93, 0xF3, 0xA3, 0xB5, (uint8_t)(UARTServiceShortUUID & 0xFF), (uint8_t)(UARTServiceShortUUID >> 8), 0x40, 0x6E
};
const uint8_t UARTServiceTXCharacteristicUUID[LENGTH_OF_LONG_UUID] = {
const uint8_t UARTServiceTXCharacteristicUUID[UUID::LENGTH_OF_LONG_UUID] = {
0x6E, 0x40, (uint8_t)(UARTServiceTXCharacteristicShortUUID >> 8), (uint8_t)(UARTServiceTXCharacteristicShortUUID & 0xFF), 0xB5, 0xA3, 0xF3, 0x93,
0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E,
};
const uint8_t UARTServiceRXCharacteristicUUID[LENGTH_OF_LONG_UUID] = {
const uint8_t UARTServiceRXCharacteristicUUID[UUID::LENGTH_OF_LONG_UUID] = {
0x6E, 0x40, (uint8_t)(UARTServiceRXCharacteristicShortUUID >> 8), (uint8_t)(UARTServiceRXCharacteristicShortUUID & 0xFF), 0xB5, 0xA3, 0xF3, 0x93,
0xE0, 0xA9, 0xE5, 0x0E, 0x24, 0xDC, 0xCA, 0x9E,
};

View File

@ -23,16 +23,16 @@
#include "UUID.h"
#include "BLEDevice.h"
extern const uint8_t UARTServiceBaseUUID[LENGTH_OF_LONG_UUID];
extern const uint8_t UARTServiceBaseUUID[UUID::LENGTH_OF_LONG_UUID];
extern const uint16_t UARTServiceShortUUID;
extern const uint16_t UARTServiceTXCharacteristicShortUUID;
extern const uint16_t UARTServiceRXCharacteristicShortUUID;
extern const uint8_t UARTServiceUUID[LENGTH_OF_LONG_UUID];
extern const uint8_t UARTServiceUUID_reversed[LENGTH_OF_LONG_UUID];
extern const uint8_t UARTServiceUUID[UUID::LENGTH_OF_LONG_UUID];
extern const uint8_t UARTServiceUUID_reversed[UUID::LENGTH_OF_LONG_UUID];
extern const uint8_t UARTServiceTXCharacteristicUUID[LENGTH_OF_LONG_UUID];
extern const uint8_t UARTServiceRXCharacteristicUUID[LENGTH_OF_LONG_UUID];
extern const uint8_t UARTServiceTXCharacteristicUUID[UUID::LENGTH_OF_LONG_UUID];
extern const uint8_t UARTServiceRXCharacteristicUUID[UUID::LENGTH_OF_LONG_UUID];
/**
* @class UARTService