mirror of https://github.com/ARMmbed/mbed-os.git
BLE: Cleanup PalSigningEventMonitor.
parent
f6b40e0e66
commit
d914cb1fb2
|
|
@ -1,33 +0,0 @@
|
||||||
/* mbed Microcontroller Library
|
|
||||||
* Copyright (c) 2006-2020 ARM Limited
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef IMPL_PAL_SIGNING_MONITOR_H_
|
|
||||||
#define IMPL_PAL_SIGNING_MONITOR_H_
|
|
||||||
|
|
||||||
#include "source/pal/PalSigningMonitor.h"
|
|
||||||
|
|
||||||
namespace ble {
|
|
||||||
|
|
||||||
class PalSigningMonitor : public interface::PalSigningMonitor {
|
|
||||||
public:
|
|
||||||
void set_signing_event_handler(PalSigningMonitorEventHandler *handler);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // ble
|
|
||||||
|
|
||||||
#endif // CORDIO_PAL_SIGNING_MONITOR_H_
|
|
||||||
|
|
@ -267,7 +267,20 @@ PalGattClient &BLEInstanceBase::getPalGattClient()
|
||||||
|
|
||||||
ble::impl::SecurityManager &BLEInstanceBase::getSecurityManagerImpl()
|
ble::impl::SecurityManager &BLEInstanceBase::getSecurityManagerImpl()
|
||||||
{
|
{
|
||||||
static PalSigningMonitor signing_event_monitor;
|
// Creation of a proxy monitor to let the security manager register to
|
||||||
|
// the gatt client and gatt server.
|
||||||
|
static struct : PalSigningMonitor {
|
||||||
|
void set_signing_event_handler(PalSigningMonitorEventHandler *handler)
|
||||||
|
{
|
||||||
|
#if BLE_FEATURE_GATT_CLIENT
|
||||||
|
BLEInstanceBase::deviceInstance().getGattClientImpl().set_signing_event_handler(handler);
|
||||||
|
#endif // BLE_FEATURE_GATT_CLIENT
|
||||||
|
#if BLE_FEATURE_GATT_SERVER
|
||||||
|
BLEInstanceBase::deviceInstance().getGattServerImpl().set_signing_event_handler(handler);
|
||||||
|
#endif // BLE_FEATURE_GATT_SERVER
|
||||||
|
}
|
||||||
|
} signing_event_monitor;
|
||||||
|
|
||||||
static ble::impl::SecurityManager m_instance(
|
static ble::impl::SecurityManager m_instance(
|
||||||
ble::impl::PalSecurityManager::get_security_manager(),
|
ble::impl::PalSecurityManager::get_security_manager(),
|
||||||
getGapImpl(),
|
getGapImpl(),
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ private:
|
||||||
|
|
||||||
void set_signing_event_handler(
|
void set_signing_event_handler(
|
||||||
PalSigningMonitorEventHandler *signing_event_handler
|
PalSigningMonitorEventHandler *signing_event_handler
|
||||||
);
|
) override;
|
||||||
|
|
||||||
EventHandler *getEventHandler();
|
EventHandler *getEventHandler();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
/* mbed Microcontroller Library
|
|
||||||
* Copyright (c) 2006-2020 ARM Limited
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*
|
|
||||||
* 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 "source/pal/PalSigningMonitor.h"
|
|
||||||
#include "source/BLEInstanceBase.h"
|
|
||||||
|
|
||||||
namespace ble {
|
|
||||||
|
|
||||||
void PalSigningMonitor::set_signing_event_handler(PalSigningMonitorEventHandler *handler)
|
|
||||||
{
|
|
||||||
#if BLE_FEATURE_GATT_CLIENT
|
|
||||||
BLEInstanceBase::deviceInstance().getGattClientImpl().set_signing_event_handler(handler);
|
|
||||||
#endif // BLE_FEATURE_GATT_CLIENT
|
|
||||||
#if BLE_FEATURE_GATT_SERVER
|
|
||||||
BLEInstanceBase::deviceInstance().getGattServerImpl().set_signing_event_handler(handler);
|
|
||||||
#endif // BLE_FEATURE_GATT_SERVER
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -167,7 +167,7 @@ private:
|
||||||
/**
|
/**
|
||||||
* @see ble::PalSigningMonitor::set_signing_event_handler
|
* @see ble::PalSigningMonitor::set_signing_event_handler
|
||||||
*/
|
*/
|
||||||
void set_signing_event_handler(PalSigningMonitorEventHandler *signing_event_handler);
|
void set_signing_event_handler(PalSigningMonitorEventHandler *signing_event_handler) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see PalGattClient::EventHandler::on_att_mtu_change
|
* @see PalGattClient::EventHandler::on_att_mtu_change
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,6 @@ public:
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace interface {
|
|
||||||
/**
|
/**
|
||||||
* Implemented by classes that need to be notified of signing events.
|
* Implemented by classes that need to be notified of signing events.
|
||||||
* Notification is done by calling functions in the passed in event handler
|
* Notification is done by calling functions in the passed in event handler
|
||||||
|
|
@ -70,14 +69,9 @@ public:
|
||||||
*
|
*
|
||||||
* @param[in] signing_event_handler Event handler being registered.
|
* @param[in] signing_event_handler Event handler being registered.
|
||||||
*/
|
*/
|
||||||
void set_signing_event_handler(PalSigningMonitorEventHandler *signing_event_handler);
|
virtual void set_signing_event_handler(PalSigningMonitorEventHandler *signing_event_handler) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace interface
|
|
||||||
} // namespace ble
|
} // namespace ble
|
||||||
|
|
||||||
/* This includes the concrete class implementation, to provide a an alternative BLE PAL implementation
|
|
||||||
* disable Cordio and place your header in a path with the same structure */
|
|
||||||
#include "ble/internal/PalSigningMonitorImpl.h"
|
|
||||||
|
|
||||||
#endif /* MBED_BLE_SIGNING_EVENT_MONITOR */
|
#endif /* MBED_BLE_SIGNING_EVENT_MONITOR */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue