type translation

pull/8738/head
paul-szczepanek-arm 2018-11-08 17:29:54 +00:00 committed by Vincent Coubard
parent 8794c0b43b
commit 78a4bdda8a
3 changed files with 23 additions and 9 deletions

View File

@ -440,7 +440,7 @@ class GapExtendedAdvertisingParams {
return _notifyOnScan;
}
/**/
/* helper get functions */
uint32_t getMinPrimaryInterval() const {
return _minInterval;
@ -450,22 +450,34 @@ class GapExtendedAdvertisingParams {
return _maxInterval;
}
BLEProtocol::AddressBytes_t* getPeerAddress() {
BLEProtocol::AddressBytes_t* getPeerAddress() const {
return &_peerAddress;
};
ble::peer_address_type_t getPeerAddressType() {
ble::peer_address_type_t getPeerAddressType() const {
return _peerAddressType;
};
ble::phy_t getPrimaryPhy() {
ble::phy_t getPrimaryPhy() const {
return _primaryPhy;
}
ble::phy_t getSecondaryPhy() {
ble::phy_t getSecondaryPhy() const {
return _secondaryPhy;
}
bool getChannel37() const {
return _channel37;
}
bool getChannel38() const {
return _channel37;
}
bool getChannel39() const {
return _channel37;
}
private:
ble::advertising_type_t _advType;
uint32_t _minInterval;

View File

@ -211,6 +211,9 @@ struct advertising_channel_map_t : SafeEnum<advertising_channel_map_t, uint8_t>
*/
advertising_channel_map_t(type value) :
SafeEnum<advertising_channel_map_t, uint8_t>(value) { }
advertising_channel_map_t(bool ch37, bool ch38, bool ch39) {
SafeEnum<advertising_channel_map_t, uint8_t>(ch37 | (ch38 << 1) | (ch39 << 2)) { }
};

View File

@ -1619,11 +1619,10 @@ ble_error_t GenericGap::setAdvertisingParams(AdvHandle_t handle, const GapAdvert
return BLE_ERROR_NONE;
}
pal::advertising_event_properties_t event_properties;//TODO
ble::advertising_type_t adv_type = params->getAdvertisingType();
pal::advertising_event_properties_t event_properties;
AddressUseType_t use_type;
switch(adv_type) {
switch(params->getAdvertisingType()) {
case ADV_SCANNABLE_UNDIRECTED:
case ADV_NON_CONNECTABLE_UNDIRECTED:
case EXT_ADV_NON_CONNECTABLE_DIRECTED:
@ -1658,7 +1657,7 @@ ble_error_t GenericGap::setAdvertisingParams(AdvHandle_t handle, const GapExtend
return BLE_ERROR_INVALID_PARAM;
}
pal::advertising_channel_map_t channel_map; /*TODO translate*/
pal::advertising_channel_map_t channel_map(params->getChannel37(), params->getChannel38(), params->getChannel39());
pal::advertising_event_properties_t event_properties;//TODO
//params->getAdvertisingType()