fix backwards compatibility

pull/13365/head
Paul Szczeanek 2020-08-07 11:58:24 +01:00
parent 1d4d3e1127
commit 98bb0f7e55
13 changed files with 53 additions and 77 deletions

View File

@ -28,16 +28,15 @@
#include "ble/types/BLETypes.h"
#include "ble/types/blecommon.h"
#include "ble/Gap.h"
#include "ble/GattClient.h"
#include "ble/GattServer.h"
#include "ble/SecurityManager.h"
/* Forward declaration for the implementation class */
namespace ble {
class BLEInstanceBase;
class Gap;
class GattClient;
class GattServer;
class SecurityManager;
}
/**
* @addtogroup ble
@ -188,9 +187,10 @@ public:
* @return A reference to a single object.
*
* @pre id shall be less than NUM_INSTANCES.
* @deprecated BLE singleton supports one instance. You may create multiple instances by using the constructor.
* Please use BLE::Instance().
*
*/
MBED_DEPRECATED_SINCE("mbed-os-6.3.0", "BLE singleton supports one instance. You may create multiple"
"instances by using the constructor. Please use BLE::Instance().")
static BLE &Instance(InstanceID_t id)
{
return Instance();
@ -200,8 +200,9 @@ public:
* Fetch the ID of a BLE instance.
*
* @return Instance id of this BLE instance.
* @deprecated BLE singleton supports one instance. You may create multiple instances by using the constructor.
*/
MBED_DEPRECATED_SINCE("mbed-os-6.3.0", "BLE singleton supports one instance. You may create multiple"
"instances by using the constructor.")
InstanceID_t getInstanceID(void) const
{
return DEFAULT_INSTANCE;
@ -475,6 +476,9 @@ private:
bool event_signaled;
};
}
using ble::BLE;
/**
* @namespace ble Entry namespace for all %BLE API definitions.
*/

View File

@ -555,7 +555,7 @@ public:
/**
* Preferred connection parameter display in Generic Access Service.
*/
typedef struct PreferredConnectionParams_t {
typedef struct {
/**
* Minimum interval between two connection events allowed for a
* connection.

View File

@ -31,17 +31,7 @@
#include "ble/Gap.h"
#include "SecurityManager.h"
#include "ble/BLE.h"
/*! Maximum count of characteristics that can be stored for authorisation purposes */
#define MAX_CHARACTERISTIC_AUTHORIZATION_CNT 20
/*! client characteristic configuration descriptors settings */
#define MAX_CCCD_CNT 20
namespace ble {
class PalAttClient;
class BLE;
/**
* @addtogroup ble

View File

@ -25,9 +25,7 @@
#include "ble/types/BLETypes.h"
#include "ble/types/blecommon.h"
#include "ble/Gap.h"
#include "ble/internal/GapTypes.h"
#include "ble/types/BLETypes.h"
#include "ble/internal/SecurityDb.h"
#include "ble/internal/PalConnectionMonitor.h"
@ -668,34 +666,6 @@ public:
*/
ble_error_t setHintFutureRoleReversal(bool enable = true);
/**
* Set the time after which an event will be generated unless we received a packet with
* a valid MIC.
*
* @param[in] connectionHandle Handle to identify the connection.
* @param[in] timeout_in_ms Timeout to set.
*
* @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
*/
ble_error_t setAuthenticationTimeout(
connection_handle_t connection,
uint32_t timeout_in_ms
);
/**
* Get the time after which an event will be generated unless we received a packet with
* a valid MIC.
*
* @param[in] connectionHandle Handle to identify the connection.
* @param[in] timeout_in_ms Returns the timeout.
*
* @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
*/
ble_error_t getAuthenticationTimeout(
connection_handle_t connection,
uint32_t *timeout_in_ms
);
////////////////////////////////////////////////////////////////////////////
// Encryption
//
@ -921,15 +891,9 @@ public:
public:
#if !defined(DOXYGEN_ONLY)
/** For backwards compatibility. This enm is now in BLETypes.h
* @deprecated, use the enum in ble namespace */
enum Keypress_t {
KEYPRESS_STARTED, /**< Passkey entry started */
KEYPRESS_ENTERED, /**< Passkey digit entered */
KEYPRESS_ERASED, /**< Passkey digit erased */
KEYPRESS_CLEARED, /**< Passkey cleared */
KEYPRESS_COMPLETED, /**< Passkey entry completed */
};
/** For backwards compatibility. This enum is now in BLETypes.h
* @deprecated use the enum in ble namespace */
typedef ble::Keypress_t Keypress_t;
#endif // !defined(DOXYGEN_ONLY)
};

View File

@ -27,11 +27,6 @@
namespace ble {
class SecurityManager;
class Gap;
class GattClient;
class GattServer;
/**
* @addtogroup ble
* @{

View File

@ -21,6 +21,7 @@
#include "ble/types/UUID.h"
#include "ble/types/GattAttribute.h"
#include "ble/types/GattCallbackParamTypes.h"
#include "ble/types/CharacteristicDescriptorDiscovery.h"
#include "ble/types/DiscoveredCharacteristicDescriptor.h"

View File

@ -22,9 +22,12 @@
#include "ble/types/UUID.h"
#include "ble/Gap.h"
#include "ble/types/GattAttribute.h"
#include "ble/GattClient.h"
#include "ble/types/CharacteristicDescriptorDiscovery.h"
namespace ble {
class GattClient;
}
/**
* @addtogroup ble
* @{

View File

@ -15,6 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "CallChainOfFunctionPointersWithContext.h"
#ifndef MBED_BLE_GATT_CALLBACK_PARAM_TYPES_H__
#define MBED_BLE_GATT_CALLBACK_PARAM_TYPES_H__

View File

@ -21,7 +21,6 @@
#include "FunctionPointerWithContext.h"
#include "ble/Gap.h"
#include "ble/types/GattAttribute.h"
#include "ble/types/GattCallbackParamTypes.h"

View File

@ -21,7 +21,6 @@
#include "ble/types/blecommon.h"
#include "ble/types/UUID.h"
#include "ble/Gap.h"
#include "ble/types/GattAttribute.h"
class DiscoveredService;

View File

@ -34,10 +34,11 @@
#include "ble/internal/PalSigningMonitor.h"
#include "ble/internal/PalSecurityManager.h"
#include "ble/SecurityManager.h"
#include "ble/internal/BLEInstanceBase.h"
namespace ble {
class BLEInstanceBase;
class SecurityManager :
public ble::interface::SecurityManager,
public ble::PalSecurityManagerEventHandler,
@ -118,16 +119,6 @@ public:
ble_error_t setHintFutureRoleReversal(bool enable = true);
ble_error_t setAuthenticationTimeout(
connection_handle_t connection,
uint32_t timeout_in_ms
);
ble_error_t getAuthenticationTimeout(
connection_handle_t connection,
uint32_t *timeout_in_ms
);
////////////////////////////////////////////////////////////////////////////
// Encryption
//
@ -196,6 +187,35 @@ public:
/* ===================================================================== */
/* private implementation follows */
private:
/**
* Set the time after which an event will be generated unless we received a packet with
* a valid MIC.
*
* @param[in] connectionHandle Handle to identify the connection.
* @param[in] timeout_in_ms Timeout to set.
*
* @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
*/
ble_error_t setAuthenticationTimeout(
connection_handle_t connection,
uint32_t timeout_in_ms
);
/**
* Get the time after which an event will be generated unless we received a packet with
* a valid MIC.
*
* @param[in] connectionHandle Handle to identify the connection.
* @param[in] timeout_in_ms Returns the timeout.
*
* @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
*/
ble_error_t getAuthenticationTimeout(
connection_handle_t connection,
uint32_t *timeout_in_ms
);
/* implements PalSecurityManager::EventHandler */
private:
////////////////////////////////////////////////////////////////////////////