mirror of https://github.com/ARMmbed/mbed-os.git
docs
parent
5dc6c1d670
commit
f3c47f135b
|
@ -51,9 +51,9 @@ public:
|
||||||
static const uint8_t MAX_ADVERTISING_SETS = 15;
|
static const uint8_t MAX_ADVERTISING_SETS = 15;
|
||||||
static const size_t MAX_HCI_DATA_LENGTH = 251;
|
static const size_t MAX_HCI_DATA_LENGTH = 251;
|
||||||
/**
|
/**
|
||||||
* Construct a GenericGap instance for a given BLE instance ID.
|
* Construct a GenericGap.
|
||||||
*
|
*
|
||||||
* @param ble_instance_id Id of the BLE instance using this instance.
|
* @param event_queue Event queue used to serialise execution.
|
||||||
*
|
*
|
||||||
* @param pal_gap GAP Platform abstraction instance containing the base GAP
|
* @param pal_gap GAP Platform abstraction instance containing the base GAP
|
||||||
* primitives.
|
* primitives.
|
||||||
|
@ -76,44 +76,66 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual ~GenericGap();
|
virtual ~GenericGap();
|
||||||
|
|
||||||
|
/** @copydoc Gap::getMaxAdvertisingSetNumber
|
||||||
|
*/
|
||||||
uint8_t getMaxAdvertisingSetNumber();
|
uint8_t getMaxAdvertisingSetNumber();
|
||||||
|
|
||||||
|
/** @copydoc Gap::getMaxAdvertisingDataLength
|
||||||
|
*/
|
||||||
uint8_t getMaxAdvertisingDataLength();
|
uint8_t getMaxAdvertisingDataLength();
|
||||||
|
|
||||||
|
/** @copydoc Gap::createAdvertisingSet
|
||||||
|
*/
|
||||||
ble_error_t createAdvertisingSet(
|
ble_error_t createAdvertisingSet(
|
||||||
AdvHandle_t *handle,
|
AdvHandle_t *handle,
|
||||||
const AdvertisingParameters ¶meters
|
const AdvertisingParameters ¶meters
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** @copydoc Gap::destroyAdvertisingSet
|
||||||
|
*/
|
||||||
ble_error_t destroyAdvertisingSet(AdvHandle_t handle);
|
ble_error_t destroyAdvertisingSet(AdvHandle_t handle);
|
||||||
|
|
||||||
|
/** @copydoc Gap::setAdvertisingParams
|
||||||
|
*/
|
||||||
ble_error_t setAdvertisingParams(
|
ble_error_t setAdvertisingParams(
|
||||||
AdvHandle_t handle,
|
AdvHandle_t handle,
|
||||||
const AdvertisingParameters ¶ms
|
const AdvertisingParameters ¶ms
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** @copydoc Gap::setAdvertisingPayload
|
||||||
|
*/
|
||||||
ble_error_t setAdvertisingPayload(
|
ble_error_t setAdvertisingPayload(
|
||||||
AdvHandle_t handle,
|
AdvHandle_t handle,
|
||||||
mbed::Span<uint8_t> payload,
|
mbed::Span<uint8_t> payload,
|
||||||
bool minimiseFragmentation
|
bool minimiseFragmentation
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** @copydoc Gap::setAdvertisingScanResponse
|
||||||
|
*/
|
||||||
ble_error_t setAdvertisingScanResponse(
|
ble_error_t setAdvertisingScanResponse(
|
||||||
AdvHandle_t handle,
|
AdvHandle_t handle,
|
||||||
mbed::Span<uint8_t> response,
|
mbed::Span<uint8_t> response,
|
||||||
bool minimiseFragmentation
|
bool minimiseFragmentation
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** @copydoc Gap::startAdvertising
|
||||||
|
*/
|
||||||
ble_error_t startAdvertising(
|
ble_error_t startAdvertising(
|
||||||
AdvHandle_t handle,
|
AdvHandle_t handle,
|
||||||
adv_duration_t maxDuration,
|
adv_duration_t maxDuration,
|
||||||
uint8_t maxEvents
|
uint8_t maxEvents
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** @copydoc Gap::stopAdvertising
|
||||||
|
*/
|
||||||
ble_error_t stopAdvertising(AdvHandle_t handle);
|
ble_error_t stopAdvertising(AdvHandle_t handle);
|
||||||
|
|
||||||
|
/** @copydoc Gap::isAdvertisingActive
|
||||||
|
*/
|
||||||
bool isAdvertisingActive(AdvHandle_t handle);
|
bool isAdvertisingActive(AdvHandle_t handle);
|
||||||
|
|
||||||
|
/** @copydoc Gap::setPeriodicAdvertisingParameters
|
||||||
|
*/
|
||||||
virtual ble_error_t setPeriodicAdvertisingParameters(
|
virtual ble_error_t setPeriodicAdvertisingParameters(
|
||||||
AdvHandle_t handle,
|
AdvHandle_t handle,
|
||||||
periodic_interval_t periodicAdvertisingIntervalMin,
|
periodic_interval_t periodicAdvertisingIntervalMin,
|
||||||
|
@ -121,25 +143,39 @@ public:
|
||||||
bool advertiseTxPower
|
bool advertiseTxPower
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** @copydoc Gap::setPeriodicAdvertisingPayload
|
||||||
|
*/
|
||||||
virtual ble_error_t setPeriodicAdvertisingPayload(
|
virtual ble_error_t setPeriodicAdvertisingPayload(
|
||||||
AdvHandle_t handle,
|
AdvHandle_t handle,
|
||||||
mbed::Span<uint8_t> payload
|
mbed::Span<uint8_t> payload
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** @copydoc Gap::startPeriodicAdvertising
|
||||||
|
*/
|
||||||
virtual ble_error_t startPeriodicAdvertising(AdvHandle_t handle);
|
virtual ble_error_t startPeriodicAdvertising(AdvHandle_t handle);
|
||||||
|
|
||||||
|
/** @copydoc Gap::stopPeriodicAdvertising
|
||||||
|
*/
|
||||||
virtual ble_error_t stopPeriodicAdvertising(AdvHandle_t handle);
|
virtual ble_error_t stopPeriodicAdvertising(AdvHandle_t handle);
|
||||||
|
|
||||||
|
/** @copydoc Gap::isPeriodicAdvertisingActive
|
||||||
|
*/
|
||||||
virtual bool isPeriodicAdvertisingActive(AdvHandle_t handle);
|
virtual bool isPeriodicAdvertisingActive(AdvHandle_t handle);
|
||||||
|
|
||||||
|
/** @copydoc Gap::setScanParameters
|
||||||
|
*/
|
||||||
virtual ble_error_t setScanParameters(const ScanParameters ¶ms);
|
virtual ble_error_t setScanParameters(const ScanParameters ¶ms);
|
||||||
|
|
||||||
|
/** @copydoc Gap::startScan
|
||||||
|
*/
|
||||||
virtual ble_error_t startScan(
|
virtual ble_error_t startScan(
|
||||||
scanning_filter_duplicates_t filtering,
|
scanning_filter_duplicates_t filtering,
|
||||||
scan_duration_t duration,
|
scan_duration_t duration,
|
||||||
scan_period_t period
|
scan_period_t period
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** @copydoc Gap::createSync
|
||||||
|
*/
|
||||||
virtual ble_error_t createSync(
|
virtual ble_error_t createSync(
|
||||||
PeerAddressType_t peerAddressType,
|
PeerAddressType_t peerAddressType,
|
||||||
uint8_t *peerAddress,
|
uint8_t *peerAddress,
|
||||||
|
@ -148,29 +184,43 @@ public:
|
||||||
sync_timeout_t timeout
|
sync_timeout_t timeout
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** @copydoc Gap::createSync
|
||||||
|
*/
|
||||||
virtual ble_error_t createSync(
|
virtual ble_error_t createSync(
|
||||||
slave_latency_t maxPacketSkip,
|
slave_latency_t maxPacketSkip,
|
||||||
sync_timeout_t timeout
|
sync_timeout_t timeout
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** @copydoc Gap::cancelCreateSync
|
||||||
|
*/
|
||||||
virtual ble_error_t cancelCreateSync();
|
virtual ble_error_t cancelCreateSync();
|
||||||
|
|
||||||
|
/** @copydoc Gap::terminateSync
|
||||||
|
*/
|
||||||
virtual ble_error_t terminateSync(PeriodicSyncHandle_t handle);
|
virtual ble_error_t terminateSync(PeriodicSyncHandle_t handle);
|
||||||
|
|
||||||
|
/** @copydoc Gap::addDeviceToPeriodicAdvertiserList
|
||||||
|
*/
|
||||||
virtual ble_error_t addDeviceToPeriodicAdvertiserList(
|
virtual ble_error_t addDeviceToPeriodicAdvertiserList(
|
||||||
PeerAddressType_t peerAddressType,
|
PeerAddressType_t peerAddressType,
|
||||||
Address_t peerAddress,
|
Address_t peerAddress,
|
||||||
uint8_t sid
|
uint8_t sid
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** @copydoc Gap::removeDeviceFromPeriodicAdvertiserList
|
||||||
|
*/
|
||||||
virtual ble_error_t removeDeviceFromPeriodicAdvertiserList(
|
virtual ble_error_t removeDeviceFromPeriodicAdvertiserList(
|
||||||
PeerAddressType_t peerAddressType,
|
PeerAddressType_t peerAddressType,
|
||||||
uint8_t *peerAddress,
|
uint8_t *peerAddress,
|
||||||
uint8_t sid
|
uint8_t sid
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/** @copydoc Gap::clearPeriodicAdvertiserList
|
||||||
|
*/
|
||||||
virtual ble_error_t clearPeriodicAdvertiserList();
|
virtual ble_error_t clearPeriodicAdvertiserList();
|
||||||
|
|
||||||
|
/** @copydoc Gap::getMaxPeriodicAdvertiserListSize
|
||||||
|
*/
|
||||||
virtual uint8_t getMaxPeriodicAdvertiserListSize();
|
virtual uint8_t getMaxPeriodicAdvertiserListSize();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -134,23 +134,21 @@ struct Gap {
|
||||||
clock_accuracy_t master_clock_accuracy
|
clock_accuracy_t master_clock_accuracy
|
||||||
) = 0;
|
) = 0;
|
||||||
|
|
||||||
/**
|
/** Called on advertising report event.
|
||||||
* Should be invoked by the Gap implementation when an extended
|
|
||||||
* advertising report event happens.
|
|
||||||
*
|
*
|
||||||
* @param event_type
|
* @param event_type Type of advertising used.
|
||||||
* @param address_type
|
* @param address_type Peer address type of advertiser.
|
||||||
* @param address
|
* @param address Peer address of advertiser.
|
||||||
* @param primary_phy
|
* @param primary_phy PHY used on the primary channels.
|
||||||
* @param secondary_phy
|
* @param secondary_phy PHY used on secondary channels.
|
||||||
* @param advertising_sid
|
* @param advertising_sid Set identification number.
|
||||||
* @param tx_power
|
* @param tx_power Transmission power reported by the packet.
|
||||||
* @param rssi
|
* @param rssi Measured signal strength.
|
||||||
* @param periodic_advertising_interval
|
* @param periodic_advertising_interval Interval of periodic advertising.
|
||||||
* @param direct_address_type
|
* @param direct_address_type Directed advertising target address type.
|
||||||
* @param direct_address
|
* @param direct_address Directed advertising target address.
|
||||||
* @param data_length
|
* @param data_length Advertising payload length.
|
||||||
* @param data_size
|
* @param data Advertising payload.
|
||||||
*
|
*
|
||||||
* @note: See Bluetooth 5 Vol 2 PartE: 7.7.65.13 LE extended advertising
|
* @note: See Bluetooth 5 Vol 2 PartE: 7.7.65.13 LE extended advertising
|
||||||
* report event.
|
* report event.
|
||||||
|
@ -171,18 +169,16 @@ struct Gap {
|
||||||
const uint8_t *data_size
|
const uint8_t *data_size
|
||||||
) = 0;
|
) = 0;
|
||||||
|
|
||||||
/**
|
/** Called on advertising sync event.
|
||||||
* TODO
|
|
||||||
* @param error
|
|
||||||
* @param sync_handle
|
|
||||||
* @param advertising_sid
|
|
||||||
* @param advertiser_address_type
|
|
||||||
* @param advertiser_address
|
|
||||||
* @param periodic_advertising_interval
|
|
||||||
* @param clock_accuracy
|
|
||||||
*
|
*
|
||||||
* @note: See Bluetooth 5 Vol 2 PartE: 7.7.65.14 LE extended advertising
|
* @param error SUCCESS if synchronisation was achieved.
|
||||||
* report event.
|
* @param sync_handle Advertising sync handle.
|
||||||
|
* @param advertising_sid Advertising set identifier.
|
||||||
|
* @param advertiser_address_type Peer address type.
|
||||||
|
* @param advertiser_address Peer address.
|
||||||
|
* @param advertiser_phy PHY used for advertisements.
|
||||||
|
* @param periodic_advertising_interval Periodic advertising interval.
|
||||||
|
* @param clock_accuracy Peer clock accuracy.
|
||||||
*/
|
*/
|
||||||
virtual void on_periodic_advertising_sync_established(
|
virtual void on_periodic_advertising_sync_established(
|
||||||
pal::hci_error_code_t error,
|
pal::hci_error_code_t error,
|
||||||
|
@ -195,14 +191,14 @@ struct Gap {
|
||||||
pal::clock_accuracy_t clock_accuracy
|
pal::clock_accuracy_t clock_accuracy
|
||||||
) = 0;
|
) = 0;
|
||||||
|
|
||||||
/**
|
/** Called after a periodic advertising report event.
|
||||||
* TODO
|
*
|
||||||
* @param sync_handle
|
* @param sync_handle Periodic advertising sync handle
|
||||||
* @param tx_power
|
* @param tx_power TX power.
|
||||||
* @param rssi
|
* @param rssi Received signal strength.
|
||||||
* @param data_status
|
* @param data_status Status to indicate the completeness of the payload.
|
||||||
* @param data_length
|
* @param data_length Periodic advertisement payload length.
|
||||||
* @param data
|
* @param data Periodic advertisement payload.
|
||||||
*/
|
*/
|
||||||
virtual void on_periodic_advertising_report(
|
virtual void on_periodic_advertising_report(
|
||||||
sync_handle_t sync_handle,
|
sync_handle_t sync_handle,
|
||||||
|
@ -213,25 +209,24 @@ struct Gap {
|
||||||
const uint8_t *data
|
const uint8_t *data
|
||||||
) = 0;
|
) = 0;
|
||||||
|
|
||||||
/**
|
/** Called on periodic advertising sync loss event.
|
||||||
* TODO
|
*
|
||||||
* @param sync_handle
|
* @param sync_handle Advertising sync handle'
|
||||||
*/
|
*/
|
||||||
virtual void on_periodic_advertising_sync_loss(
|
virtual void on_periodic_advertising_sync_loss(
|
||||||
sync_handle_t sync_handle
|
sync_handle_t sync_handle
|
||||||
) = 0;
|
) = 0;
|
||||||
|
|
||||||
/**
|
/** Called when scanning times out.
|
||||||
* TODO
|
|
||||||
*/
|
*/
|
||||||
virtual void on_scan_timeout() = 0;
|
virtual void on_scan_timeout() = 0;
|
||||||
|
|
||||||
/**
|
/** Called when advertising set stops advertising.
|
||||||
* TODO
|
*
|
||||||
* @param status
|
* @param status SUCCESS if connection has been established.
|
||||||
* @param advertising_handle
|
* @param advertising_handle Advertising set handle.
|
||||||
* @param connection_handle
|
* @param advertising_handle Connection handle.
|
||||||
* @param number_of_completed_extended_advertising_events
|
* @param number_of_completed_extended_advertising_events Number of events created during before advertising end.
|
||||||
*/
|
*/
|
||||||
virtual void on_advertising_set_terminated(
|
virtual void on_advertising_set_terminated(
|
||||||
hci_error_code_t status,
|
hci_error_code_t status,
|
||||||
|
@ -240,11 +235,11 @@ struct Gap {
|
||||||
uint8_t number_of_completed_extended_advertising_events
|
uint8_t number_of_completed_extended_advertising_events
|
||||||
) = 0;
|
) = 0;
|
||||||
|
|
||||||
/**
|
/** Called when a device receives a scan request from an active scanning device.
|
||||||
* TODO
|
*
|
||||||
* @param advertising_handle
|
* @param advertising_handle Advertising set handle.
|
||||||
* @param scanner_address_type
|
* @param scanner_address_type Peer address type.
|
||||||
* @param address
|
* @param address Peer address.
|
||||||
*/
|
*/
|
||||||
virtual void on_scan_request_received(
|
virtual void on_scan_request_received(
|
||||||
advertising_handle_t advertising_handle,
|
advertising_handle_t advertising_handle,
|
||||||
|
|
Loading…
Reference in New Issue