From 6b06ea38c13617e477432d4c59f1b32952233874 Mon Sep 17 00:00:00 2001 From: Rohit Grover Date: Fri, 23 May 2014 15:21:16 +0100 Subject: [PATCH] minor improvement to the API --- GapAdvertisingParams.cpp | 30 ---------------------- GapAdvertisingParams.h | 54 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 30 deletions(-) diff --git a/GapAdvertisingParams.cpp b/GapAdvertisingParams.cpp index ea91706..1f87049 100644 --- a/GapAdvertisingParams.cpp +++ b/GapAdvertisingParams.cpp @@ -129,33 +129,3 @@ GapAdvertisingParams::GapAdvertisingParams(AdvertisingType advType, GapAdvertisingParams::~GapAdvertisingParams(void) { } - -/**************************************************************************/ -/*! - \brief returns the current Advertising Type value -*/ -/**************************************************************************/ -GapAdvertisingParams::AdvertisingType GapAdvertisingParams::getAdvertisingType(void) const -{ - return _advType; -} - -/**************************************************************************/ -/*! - \brief returns the current Advertising Delay (in units of 0.625ms) -*/ -/**************************************************************************/ -uint16_t GapAdvertisingParams::getInterval(void) const -{ - return _interval; -} - -/**************************************************************************/ -/*! - \brief returns the current Advertising Timeout (in seconds) -*/ -/**************************************************************************/ -uint16_t GapAdvertisingParams::getTimeout(void) const -{ - return _timeout; -} diff --git a/GapAdvertisingParams.h b/GapAdvertisingParams.h index 0dc1a97..cd6080e 100644 --- a/GapAdvertisingParams.h +++ b/GapAdvertisingParams.h @@ -83,6 +83,10 @@ public: uint16_t timeout = 0); virtual ~GapAdvertisingParams(void); + void setAdvertisingType(AdvertisingType newAdvType); + void setInterval(uint16_t newInterval); + void setTimeout(uint16_t newTimeout); + virtual AdvertisingType getAdvertisingType(void) const; virtual uint16_t getInterval(void) const; virtual uint16_t getTimeout(void) const; @@ -93,4 +97,54 @@ private: uint16_t _timeout; }; +inline void +GapAdvertisingParams::setAdvertisingType(AdvertisingType newAdvType) { + _advType = newAdvType; +} + +inline void +GapAdvertisingParams::setInterval(uint16_t newInterval) { + _interval = newInterval; +} + +inline void +GapAdvertisingParams::setTimeout(uint16_t newTimeout) { + _timeout = newTimeout; +} + + +/**************************************************************************/ +/*! + \brief returns the current Advertising Type value +*/ +/**************************************************************************/ +inline GapAdvertisingParams::AdvertisingType +GapAdvertisingParams::getAdvertisingType(void) const +{ + return _advType; +} + +/**************************************************************************/ +/*! + \brief returns the current Advertising Delay (in units of 0.625ms) +*/ +/**************************************************************************/ +inline uint16_t +GapAdvertisingParams::getInterval(void) const +{ + return _interval; +} + +/**************************************************************************/ +/*! + \brief returns the current Advertising Timeout (in seconds) +*/ +/**************************************************************************/ +inline uint16_t +GapAdvertisingParams::getTimeout(void) const +{ + return _timeout; +} + + #endif // ifndef __GAP_ADVERTISING_PARAMS_H__