mirror of https://github.com/ARMmbed/mbed-os.git
BLE: Cleanup pal generic access service
parent
b42abd0e25
commit
f6b40e0e66
|
@ -27,15 +27,15 @@ namespace impl {
|
|||
class GattServer;
|
||||
}
|
||||
|
||||
|
||||
namespace impl {
|
||||
/**
|
||||
* Implementation of ble::PalGenericAccessService for the Cordio stack.
|
||||
*/
|
||||
class PalGenericAccessService : public interface::PalGenericAccessService {
|
||||
class PalGenericAccessService final : public ble::PalGenericAccessService {
|
||||
public:
|
||||
PalGenericAccessService() { }
|
||||
PalGenericAccessService() = default;
|
||||
|
||||
virtual ~PalGenericAccessService() { }
|
||||
~PalGenericAccessService() = default;
|
||||
|
||||
#if 0 // Disabled until reworked and reintroduced to GattServer API
|
||||
virtual ble_error_t get_device_name_length(uint8_t& length);
|
||||
|
@ -45,20 +45,23 @@ public:
|
|||
virtual ble_error_t set_appearance(GapAdvertisingData::Appearance appearance);
|
||||
#endif // Disabled until reworked and reintroduced to GattServer API
|
||||
|
||||
virtual ble_error_t get_peripheral_preferred_connection_parameters(
|
||||
ble::Gap::PreferredConnectionParams_t& parameters
|
||||
);
|
||||
ble_error_t get_peripheral_preferred_connection_parameters(
|
||||
ble::Gap::PreferredConnectionParams_t ¶meters
|
||||
) final;
|
||||
|
||||
virtual ble_error_t set_peripheral_preferred_connection_parameters(
|
||||
const ble::Gap::PreferredConnectionParams_t& parameters
|
||||
);
|
||||
ble_error_t set_peripheral_preferred_connection_parameters(
|
||||
const ble::Gap::PreferredConnectionParams_t ¶meters
|
||||
) final;
|
||||
|
||||
private:
|
||||
#if BLE_FEATURE_GATT_SERVER
|
||||
ble::impl::GattServer& gatt_server();
|
||||
|
||||
ble::impl::GattServer &gatt_server();
|
||||
|
||||
#endif // BLE_FEATURE_GATT_SERVER
|
||||
};
|
||||
|
||||
} // ble
|
||||
} // namespace impl
|
||||
} // namespace ble
|
||||
|
||||
#endif /* IMPL_PAL_GENERIC_ACCESS_SERVICE_ */
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include "PalSecurityManagerImpl.h"
|
||||
|
||||
#include "internal/PalAttClientImpl.h"
|
||||
#include "internal/PalGenericAccessServiceImpl.h"
|
||||
#include "PalGapImpl.h"
|
||||
|
||||
|
||||
|
@ -193,7 +194,7 @@ const char *BLEInstanceBase::getVersion()
|
|||
|
||||
ble::impl::Gap &BLEInstanceBase::getGapImpl()
|
||||
{
|
||||
static ble::PalGenericAccessService cordio_gap_service;
|
||||
static ble::impl::PalGenericAccessService cordio_gap_service;
|
||||
static ble::impl::Gap gap(
|
||||
_event_queue,
|
||||
ble::impl::PalGap::get_gap(),
|
||||
|
|
|
@ -16,10 +16,11 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "source/pal/PalGenericAccessService.h"
|
||||
#include "internal/PalGenericAccessServiceImpl.h"
|
||||
#include "GattServerImpl.h"
|
||||
|
||||
namespace ble {
|
||||
namespace impl {
|
||||
|
||||
#if 0 // Disabled until reworked and reintroduced to GattServer API
|
||||
|
||||
|
@ -91,7 +92,7 @@ virtual ble_error_t PalGenericAccessService::get_device_name_length(uint8_t& len
|
|||
|
||||
|
||||
ble_error_t PalGenericAccessService::get_peripheral_preferred_connection_parameters(
|
||||
ble::Gap::PreferredConnectionParams_t& parameters
|
||||
ble::Gap::PreferredConnectionParams_t ¶meters
|
||||
)
|
||||
{
|
||||
#if BLE_FEATURE_GATT_SERVER
|
||||
|
@ -103,7 +104,7 @@ ble_error_t PalGenericAccessService::get_peripheral_preferred_connection_paramet
|
|||
}
|
||||
|
||||
ble_error_t PalGenericAccessService::set_peripheral_preferred_connection_parameters(
|
||||
const ble::Gap::PreferredConnectionParams_t& parameters
|
||||
const ble::Gap::PreferredConnectionParams_t ¶meters
|
||||
)
|
||||
{
|
||||
#if BLE_FEATURE_GATT_SERVER
|
||||
|
@ -116,12 +117,15 @@ ble_error_t PalGenericAccessService::set_peripheral_preferred_connection_paramet
|
|||
|
||||
|
||||
#if BLE_FEATURE_GATT_SERVER
|
||||
ble::impl::GattServer& PalGenericAccessService::gatt_server()
|
||||
|
||||
ble::impl::GattServer &PalGenericAccessService::gatt_server()
|
||||
{
|
||||
return ble::impl::GattServer::getInstance();
|
||||
}
|
||||
|
||||
#endif // BLE_FEATURE_GATT_SERVER
|
||||
|
||||
} // ble
|
||||
} // namespace impl
|
||||
} // namespace ble
|
||||
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "ble/Gap.h"
|
||||
|
||||
namespace ble {
|
||||
namespace interface {
|
||||
|
||||
/**
|
||||
* Manage state of the GAP service exposed by the GATT server.
|
||||
|
@ -70,11 +69,6 @@ public:
|
|||
) = 0;
|
||||
};
|
||||
|
||||
} // namespace interface
|
||||
} // 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/PalGenericAccessServiceImpl.h"
|
||||
|
||||
#endif /* BLE_PAL_GENERIC_ACCESS_SERVICE_H_ */
|
||||
|
|
Loading…
Reference in New Issue