move the static declarations for char UUIDs out of URIBeaconConfigService.h into .cpp.

This commit is contained in:
Rohit Grover 2015-06-04 09:22:22 +01:00
parent d9283d5868
commit 73a6be23d8
2 changed files with 46 additions and 16 deletions

View file

@ -0,0 +1,35 @@
/* mbed Microcontroller Library
* Copyright (c) 2006-2013 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "URIBeaconConfigService.h"
#define UUID_URI_BEACON(FIRST, SECOND) { \
0xee, 0x0c, FIRST, SECOND, 0x87, 0x86, 0x40, 0xba, \
0xab, 0x96, 0x99, 0xb9, 0x1a, 0xc9, 0x81, 0xd8, \
}
const uint8_t UUID_URI_BEACON_SERVICE[LENGTH_OF_LONG_UUID] = UUID_URI_BEACON(0x20, 0x80);
const uint8_t UUID_LOCK_STATE_CHAR[LENGTH_OF_LONG_UUID] = UUID_URI_BEACON(0x20, 0x81);
const uint8_t UUID_LOCK_CHAR[LENGTH_OF_LONG_UUID] = UUID_URI_BEACON(0x20, 0x82);
const uint8_t UUID_UNLOCK_CHAR[LENGTH_OF_LONG_UUID] = UUID_URI_BEACON(0x20, 0x83);
const uint8_t UUID_URI_DATA_CHAR[LENGTH_OF_LONG_UUID] = UUID_URI_BEACON(0x20, 0x84);
const uint8_t UUID_FLAGS_CHAR[LENGTH_OF_LONG_UUID] = UUID_URI_BEACON(0x20, 0x85);
const uint8_t UUID_ADV_POWER_LEVELS_CHAR[LENGTH_OF_LONG_UUID] = UUID_URI_BEACON(0x20, 0x86);
const uint8_t UUID_TX_POWER_MODE_CHAR[LENGTH_OF_LONG_UUID] = UUID_URI_BEACON(0x20, 0x87);
const uint8_t UUID_BEACON_PERIOD_CHAR[LENGTH_OF_LONG_UUID] = UUID_URI_BEACON(0x20, 0x88);
const uint8_t UUID_RESET_CHAR[LENGTH_OF_LONG_UUID] = UUID_URI_BEACON(0x20, 0x89);
const uint8_t BEACON_UUID[sizeof(ShortUUIDBytes_t)] = {0xD8, 0xFE};

View file

@ -20,23 +20,18 @@
#include "BLEDevice.h"
#include "mbed.h"
#define UUID_URI_BEACON(FIRST, SECOND) { \
0xee, 0x0c, FIRST, SECOND, 0x87, 0x86, 0x40, 0xba, \
0xab, 0x96, 0x99, 0xb9, 0x1a, 0xc9, 0x81, 0xd8, \
}
extern const uint8_t UUID_URI_BEACON_SERVICE[LENGTH_OF_LONG_UUID];
extern const uint8_t UUID_LOCK_STATE_CHAR[LENGTH_OF_LONG_UUID];
extern const uint8_t UUID_LOCK_CHAR[LENGTH_OF_LONG_UUID];
extern const uint8_t UUID_UNLOCK_CHAR[LENGTH_OF_LONG_UUID];
extern const uint8_t UUID_URI_DATA_CHAR[LENGTH_OF_LONG_UUID];
extern const uint8_t UUID_FLAGS_CHAR[LENGTH_OF_LONG_UUID];
extern const uint8_t UUID_ADV_POWER_LEVELS_CHAR[LENGTH_OF_LONG_UUID];
extern const uint8_t UUID_TX_POWER_MODE_CHAR[LENGTH_OF_LONG_UUID];
extern const uint8_t UUID_BEACON_PERIOD_CHAR[LENGTH_OF_LONG_UUID];
extern const uint8_t UUID_RESET_CHAR[LENGTH_OF_LONG_UUID];
static const uint8_t UUID_URI_BEACON_SERVICE[] = UUID_URI_BEACON(0x20, 0x80);
static const uint8_t UUID_LOCK_STATE_CHAR[] = UUID_URI_BEACON(0x20, 0x81);
static const uint8_t UUID_LOCK_CHAR[] = UUID_URI_BEACON(0x20, 0x82);
static const uint8_t UUID_UNLOCK_CHAR[] = UUID_URI_BEACON(0x20, 0x83);
static const uint8_t UUID_URI_DATA_CHAR[] = UUID_URI_BEACON(0x20, 0x84);
static const uint8_t UUID_FLAGS_CHAR[] = UUID_URI_BEACON(0x20, 0x85);
static const uint8_t UUID_ADV_POWER_LEVELS_CHAR[] = UUID_URI_BEACON(0x20, 0x86);
static const uint8_t UUID_TX_POWER_MODE_CHAR[] = UUID_URI_BEACON(0x20, 0x87);
static const uint8_t UUID_BEACON_PERIOD_CHAR[] = UUID_URI_BEACON(0x20, 0x88);
static const uint8_t UUID_RESET_CHAR[] = UUID_URI_BEACON(0x20, 0x89);
static const uint8_t BEACON_UUID[] = {0xD8, 0xFE};
extern const uint8_t BEACON_UUID[sizeof(ShortUUIDBytes_t)];
/**
* @class URIBeaconConfigService