
simple project to control mirrorless camera
Dependencies: mbed BLE_API nRF51822
Diff: bleservices/ServicePower.h
- Revision:
- 3:38ec35b54db8
- Parent:
- 2:ed001667a2b6
--- a/bleservices/ServicePower.h Thu Oct 22 09:08:15 2015 +0000 +++ b/bleservices/ServicePower.h Thu Oct 22 19:52:59 2015 +0000 @@ -6,14 +6,9 @@ #include "Light.h" #include "FlashStore.h" -#define UUID_POWER(FIRST, SECOND) {\ -0xd4, 0x9f, FIRST, SECOND, 0xce,0xb2, 0x4c, 0x39, 0xa4, 0xea,\ -0x85, 0xfa, 0xfa, 0xae, 0x22, 0xbf\ -} - -static const uint8_t UUID_power_service[] = UUID_POWER(0x20, 0x80); -static const uint8_t UUID_power_value_char[] = UUID_POWER(0x20, 0x81); -static const uint8_t UUID_power_state_char[] = UUID_POWER(0x20, 0x82); +extern const uint8_t Power_service_UUID[UUID::LENGTH_OF_LONG_UUID]; +extern const uint8_t Power_value_char_UUID[UUID::LENGTH_OF_LONG_UUID]; +extern const uint8_t Power_state_char_UUID[UUID::LENGTH_OF_LONG_UUID]; class ServicePower { @@ -24,8 +19,8 @@ Power(_Power), dayLight(_dayLight), Store(_Store), - valueCharacteristic(UUID_power_value_char, &powerValue, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY), - stateCharacteristic(UUID_power_state_char, &powerState) + valueCharacteristic(Power_value_char_UUID, &powerValue, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY), + stateCharacteristic(Power_state_char_UUID, &powerState) { setupService(); } @@ -44,7 +39,7 @@ protected: void setupService(void) { GattCharacteristic *characteristics[] = {&stateCharacteristic, &valueCharacteristic}; - GattService powerService(UUID_power_service, characteristics, sizeof(characteristics) / sizeof(GattCharacteristic *)); + GattService powerService(Power_service_UUID, characteristics, sizeof(characteristics) / sizeof(GattCharacteristic *)); powerState = false; powerValue = 0.0;