mirror of https://github.com/ARMmbed/mbed-os.git
event types fixed
parent
9b77f9dcba
commit
8733d52da9
|
@ -1183,6 +1183,21 @@ public:
|
|||
(void) connected;
|
||||
}
|
||||
|
||||
struct AdvertisingReportEvent_t {
|
||||
AdvertisingEventType_t type;
|
||||
PeerAddressType_t peerAddressType;
|
||||
ble::address_t const &peerAddress;
|
||||
Phy_t primaryPhy;
|
||||
Phy_t secondaryPhy;
|
||||
uint8_t SID;
|
||||
int8_t txPower;
|
||||
int8_t rssi;
|
||||
int16_t periodicInterval;
|
||||
PeerAddressType_t directAddressType;
|
||||
const ble::address_t &directAddress;
|
||||
mbed::Span<const uint8_t> advertisingData;
|
||||
};
|
||||
|
||||
/**
|
||||
* FIXME
|
||||
* @param type
|
||||
|
@ -1199,31 +1214,29 @@ public:
|
|||
* @param advertisingData
|
||||
*/
|
||||
void onAdvertisingReport(
|
||||
AdvertisingEventType_t type,
|
||||
PeerAddressType_t peerAddressType,
|
||||
BLEProtocol::AddressBytes_t const &peerAddress,
|
||||
Phy_t primaryPhy,
|
||||
Phy_t secondaryPhy,
|
||||
uint8_t SID,
|
||||
int8_t txPower,
|
||||
int8_t rssi,
|
||||
int16_t periodicInterval,
|
||||
PeerAddressType_t directAddressType,
|
||||
BLEProtocol::AddressBytes_t directAddress,
|
||||
mbed::Span<const uint8_t> advertisingData
|
||||
const AdvertisingReportEvent_t &event
|
||||
) {
|
||||
(void) type;
|
||||
(void) peerAddressType;
|
||||
(void) peerAddress;
|
||||
(void) primaryPhy;
|
||||
(void) secondaryPhy;
|
||||
(void) SID;
|
||||
(void) txPower;
|
||||
(void) rssi;
|
||||
(void) periodicInterval;
|
||||
(void) directAddressType;
|
||||
(void) directAddress;
|
||||
(void) advertisingData;
|
||||
(void) event;
|
||||
}
|
||||
|
||||
struct ConnectionCompleteEvent_t {
|
||||
bool success;
|
||||
Handle_t connectionHandle;
|
||||
Role_t ownRole;
|
||||
PeerAddressType_t peerAddressType;
|
||||
const ble::address_t &peerAddress;
|
||||
const ble::address_t &localResolvablePrivateAddress;
|
||||
const ble::address_t &peerResolvablePrivateAddress;
|
||||
uint16_t connectionInterval_us;
|
||||
uint16_t connectionLatency;
|
||||
uint16_t supervisionTimeout_ms;
|
||||
uint16_t masterClockAccuracy_ppm;
|
||||
};
|
||||
|
||||
void onConnectionComplete(
|
||||
const ConnectionCompleteEvent_t &event
|
||||
) {
|
||||
(void)event;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1285,32 +1298,6 @@ public:
|
|||
(void)rxPhy;
|
||||
}
|
||||
|
||||
void onConnectionComplete(
|
||||
bool success,
|
||||
Handle_t connectionHandle,
|
||||
Role_t ownRole,
|
||||
PeerAddressType_t peerAddressType,
|
||||
const ble::address_t &peerAddress,
|
||||
const ble::address_t &localResolvablePrivateAddress,
|
||||
const ble::address_t &peerResolvablePrivateAddress,
|
||||
uint16_t connectionInterval_us,
|
||||
uint16_t connectionLatency,
|
||||
uint16_t supervisionTimeout_ms,
|
||||
uint16_t masterClockAccuracy_ppm
|
||||
) {
|
||||
(void)success;
|
||||
(void)connectionHandle;
|
||||
(void)ownRole;
|
||||
(void)peerAddressType;
|
||||
(void)peerAddress;
|
||||
(void)localResolvablePrivateAddress;
|
||||
(void)peerResolvablePrivateAddress;
|
||||
(void)connectionInterval_us;
|
||||
(void)connectionLatency;
|
||||
(void)supervisionTimeout_ms;
|
||||
(void)masterClockAccuracy_ppm;
|
||||
}
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Prevent polymorphic deletion and avoid unnecessary virtual destructor
|
||||
|
@ -1538,7 +1525,7 @@ public:
|
|||
*/
|
||||
virtual ble_error_t connect(
|
||||
TargetPeerAddressType_t peerAddressType,
|
||||
const BLEProtocol::AddressBytes_t &peerAddress,
|
||||
const ble::address_t &peerAddress,
|
||||
const GapExtendedConnectParameters_t &connectionParams
|
||||
) {
|
||||
(void)peerAddressType;
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
_scanInterval[i] = 4;
|
||||
_scanWindow[i] = 4;
|
||||
_minConnectionInterval[i] = 6;
|
||||
_maxConnectionInterval[i] = 6;
|
||||
_maxConnectionInterval[i] = 0xC80;
|
||||
_slaveLatency[i] = 0;
|
||||
_connectionSupervisionTimeout[i] = 0xC80;
|
||||
_minEventLength[i] = 0;
|
||||
|
|
|
@ -236,7 +236,7 @@ public:
|
|||
*/
|
||||
virtual ble_error_t connect(
|
||||
ble::target_peer_address_type_t peerAddressType,
|
||||
const BLEProtocol::AddressBytes_t &peerAddress,
|
||||
const ble::address_t &peerAddress,
|
||||
const GapExtendedConnectParameters_t &connectionParams
|
||||
);
|
||||
|
||||
|
|
|
@ -604,7 +604,7 @@ ble_error_t GenericGap::connect(
|
|||
|
||||
ble_error_t GenericGap::connect(
|
||||
ble::target_peer_address_type_t peerAddressType,
|
||||
const BLEProtocol::AddressBytes_t &peerAddress,
|
||||
const ble::address_t &peerAddress,
|
||||
const GapExtendedConnectParameters_t &connectionParams
|
||||
) {
|
||||
if (!connectionParams.getNumberOfEnabledPhys()) {
|
||||
|
@ -2178,7 +2178,7 @@ void GenericGap::on_enhanced_connection_complete(
|
|||
pal::clock_accuracy_t master_clock_accuracy
|
||||
) {
|
||||
if (_eventHandler) {
|
||||
_eventHandler->onConnectionComplete(
|
||||
Gap::EventHandler::ConnectionCompleteEvent_t event = {
|
||||
(status==pal::hci_error_code_t::SUCCESS),
|
||||
(ble::connection_handle_t)connection_handle,
|
||||
(Gap::Role_t)own_role.value(),
|
||||
|
@ -2190,7 +2190,9 @@ void GenericGap::on_enhanced_connection_complete(
|
|||
connection_latency,
|
||||
supervision_timeout * 10,
|
||||
master_clock_accuracy.getPpm()
|
||||
);
|
||||
};
|
||||
|
||||
_eventHandler->onConnectionComplete(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2211,7 +2213,7 @@ void GenericGap::on_extended_advertising_report(
|
|||
)
|
||||
{
|
||||
if (_eventHandler) {
|
||||
_eventHandler->onAdvertisingReport(
|
||||
Gap::EventHandler::AdvertisingReportEvent_t event = {
|
||||
event_type,
|
||||
(PeerAddressType_t::type)(address_type? address_type->value() : connection_peer_address_type_t::PUBLIC_ADDRESS),
|
||||
(BLEProtocol::AddressBytes_t&)address,
|
||||
|
@ -2224,7 +2226,9 @@ void GenericGap::on_extended_advertising_report(
|
|||
(PeerAddressType_t::type)direct_address_type.value(),
|
||||
(BLEProtocol::AddressBytes_t&)direct_address,
|
||||
mbed::make_Span(data, data_length)
|
||||
);
|
||||
};
|
||||
|
||||
_eventHandler->onAdvertisingReport(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue