mirror of https://github.com/ARMmbed/mbed-os.git
compiler errors fixed after the merge
parent
8cf7b3b06f
commit
ecacbda507
|
@ -370,11 +370,11 @@ struct address_t : public octet_type_t<6> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Initialize a mac address from an array of bytes.
|
||||
* Initialize a data from an array of bytes.
|
||||
*
|
||||
* @param input_value value of the MAC address.
|
||||
* @param input_value value of the data.
|
||||
*/
|
||||
address_t(const uint8_t (&input_value)[6]) {
|
||||
address_t(const uint8_t *input_value) {
|
||||
memcpy(_value, input_value, sizeof(_value));
|
||||
}
|
||||
|
||||
|
@ -386,7 +386,7 @@ struct address_t : public octet_type_t<6> {
|
|||
*
|
||||
* @param tag Tag used to select this constructor. The value does not matter.
|
||||
*/
|
||||
address_t(const uint8_t* input_value, bool tag) {
|
||||
address_t(const uint8_t *input_value, bool tag) {
|
||||
memcpy(_value, input_value, sizeof(_value));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
namespace ble {
|
||||
|
||||
class ConnectionEventHandler {
|
||||
public:
|
||||
virtual void on_connected(
|
||||
connection_handle_t connection,
|
||||
Gap::Role_t role,
|
||||
|
@ -42,20 +43,21 @@ class ConnectionEventHandler {
|
|||
const Gap::ConnectionParams_t *connection_params
|
||||
) = 0;
|
||||
|
||||
void on_disconnected(
|
||||
virtual void on_disconnected(
|
||||
connection_handle_t connection,
|
||||
Gap::DisconnectionReason_t reason
|
||||
) = 0;
|
||||
};
|
||||
|
||||
class ConnectionEventMonitor {
|
||||
public:
|
||||
/**
|
||||
* Register a handler for connection events to be used internally and serviced first.
|
||||
*
|
||||
* @param[in] connection_event_handler Event handler being registered.
|
||||
*/
|
||||
void set_connection_event_handler(ConnectionEventHandler *connection_event_handler) = 0;
|
||||
}
|
||||
virtual void set_connection_event_handler(ConnectionEventHandler *connection_event_handler) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -272,6 +272,11 @@ public:
|
|||
DisconnectionReason_t reason
|
||||
);
|
||||
|
||||
/** @note Implements ConnectionEventMonitor.
|
||||
* @copydoc ConnectionEventMonitor::set_connection_event_handler
|
||||
*/
|
||||
virtual void set_connection_event_handler(ConnectionEventHandler *_connection_event_handler);
|
||||
|
||||
private:
|
||||
void on_scan_timeout();
|
||||
|
||||
|
@ -301,9 +306,6 @@ private:
|
|||
|
||||
bool initialize_whitelist() const;
|
||||
|
||||
/** implements ConnectionEventMonitor */
|
||||
void set_connection_event_handler(ConnectionEventHandler *_connection_event_handler);
|
||||
|
||||
pal::EventQueue& _event_queue;
|
||||
pal::Gap &_pal_gap;
|
||||
pal::GenericAccessService &_gap_service;
|
||||
|
|
|
@ -390,7 +390,7 @@ private:
|
|||
* @param[in] peer_address Address of the connected device.
|
||||
* @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
|
||||
*/
|
||||
void on_connected(
|
||||
virtual void on_connected(
|
||||
connection_handle_t connection,
|
||||
Gap::Role_t role,
|
||||
BLEProtocol::AddressType_t peer_address_type,
|
||||
|
@ -407,7 +407,7 @@ private:
|
|||
* @param[in] connectionHandle Handle to identify the connection.
|
||||
* @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
|
||||
*/
|
||||
void on_disconnected(
|
||||
virtual void on_disconnected(
|
||||
connection_handle_t connection,
|
||||
Gap::DisconnectionReason_t reason
|
||||
);
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#define PAL_MEMORY_SECURITY_MANAGER_DB_H__
|
||||
|
||||
#include "SecurityDB.h"
|
||||
#include "Gap.h"
|
||||
|
||||
namespace ble {
|
||||
namespace pal {
|
||||
|
@ -341,12 +342,12 @@ public:
|
|||
_local_csrk = csrk_t();
|
||||
}
|
||||
|
||||
virtual void get_whitelist(WhitelistDbCb_t cb, Gap::Whitelist_t *whitelist) {
|
||||
virtual void get_whitelist(WhitelistDbCb_t cb, ::Gap::Whitelist_t *whitelist) {
|
||||
/*TODO: fill whitelist*/
|
||||
cb(whitelist);
|
||||
}
|
||||
|
||||
virtual void generate_whitelist_from_bond_table(WhitelistDbCb_t cb, Gap::Whitelist_t *whitelist) {
|
||||
virtual void generate_whitelist_from_bond_table(WhitelistDbCb_t cb, ::Gap::Whitelist_t *whitelist) {
|
||||
for (size_t i = 0; i < MAX_ENTRIES && i < whitelist->capacity; i++) {
|
||||
if (_db[i].entry.peer_address_is_public) {
|
||||
whitelist->addresses[i].type = BLEProtocol::AddressType::PUBLIC;
|
||||
|
@ -364,9 +365,9 @@ public:
|
|||
cb(whitelist);
|
||||
}
|
||||
|
||||
virtual void update_whitelist(Gap::Whitelist_t &whitelist) { }
|
||||
virtual void update_whitelist(::Gap::Whitelist_t &whitelist) { }
|
||||
|
||||
virtual void set_whitelist(const Gap::Whitelist_t &whitelist) { };
|
||||
virtual void set_whitelist(const ::Gap::Whitelist_t &whitelist) { };
|
||||
|
||||
virtual void add_whitelist_entry(const address_t &address) { }
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
namespace ble {
|
||||
namespace pal {
|
||||
|
||||
using pal::connection_peer_address_type_t;
|
||||
|
||||
/* separate structs for keys to allow db implementation
|
||||
* to minimise memory usage, only holding live connection
|
||||
* state in memory */
|
||||
|
@ -127,7 +125,7 @@ struct SecurityEntryIdentity_t {
|
|||
|
||||
typedef mbed::Callback<void(const SecurityEntry_t*, const SecurityEntryKeys_t*)> SecurityEntryKeysDbCb_t;
|
||||
typedef mbed::Callback<void(connection_handle_t, const csrk_t*)> SecurityEntryCsrkDbCb_t;
|
||||
typedef mbed::Callback<void(Gap::Whitelist_t*)> WhitelistDbCb_t;
|
||||
typedef mbed::Callback<void(::Gap::Whitelist_t*)> WhitelistDbCb_t;
|
||||
|
||||
/**
|
||||
* SecurityDB holds the state for active connections and bonded devices.
|
||||
|
@ -475,7 +473,7 @@ public:
|
|||
*/
|
||||
virtual void get_whitelist(
|
||||
WhitelistDbCb_t cb,
|
||||
Gap::Whitelist_t *whitelist
|
||||
::Gap::Whitelist_t *whitelist
|
||||
) = 0;
|
||||
|
||||
/**
|
||||
|
@ -488,7 +486,7 @@ public:
|
|||
*/
|
||||
virtual void generate_whitelist_from_bond_table(
|
||||
WhitelistDbCb_t cb,
|
||||
Gap::Whitelist_t *whitelist
|
||||
::Gap::Whitelist_t *whitelist
|
||||
) = 0;
|
||||
|
||||
/**
|
||||
|
@ -497,7 +495,7 @@ public:
|
|||
* @param[in] whitelist
|
||||
*/
|
||||
virtual void set_whitelist(
|
||||
const Gap::Whitelist_t &whitelist
|
||||
const ::Gap::Whitelist_t &whitelist
|
||||
) = 0;
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <stddef.h>
|
||||
|
||||
#include "ble/generic/GenericSecurityManager.h"
|
||||
#include "ble/generic/GenericSecurityDb.h"
|
||||
#include "ble/pal/MemorySecurityDb.h"
|
||||
#include "ble/generic/GenericGap.h"
|
||||
#include "ble/pal/PalSecurityManager.h"
|
||||
#include "CordioPalSecurityManager.h"
|
||||
|
@ -36,16 +36,16 @@ class SecurityManager : public generic::GenericSecurityManager
|
|||
public:
|
||||
static SecurityManager &getInstance()
|
||||
{
|
||||
static generic::MemoryGenericSecurityDb m_db;
|
||||
static pal::MemorySecurityDb m_db;
|
||||
static pal::vendor::cordio::CordioSecurityManager m_pal;
|
||||
static SecurityManager m_instance(m_pal, m_db, cordio::Gap::getInstance());
|
||||
static SecurityManager m_instance(m_pal, m_db, *(reinterpret_cast<generic::GenericGap*>(&(cordio::Gap::getInstance()))));
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
public:
|
||||
SecurityManager(
|
||||
pal::SecurityManager &palImpl,
|
||||
generic::GenericSecurityDb &dbImpl,
|
||||
pal::SecurityDb &dbImpl,
|
||||
generic::GenericGap &gapImpl
|
||||
) : generic::GenericSecurityManager(palImpl, dbImpl, gapImpl) {
|
||||
/* empty */
|
||||
|
|
Loading…
Reference in New Issue