mirror of https://github.com/ARMmbed/mbed-os.git
BLE: Move implementation to cpp file.
parent
87014b71b6
commit
ad3f3c86a5
|
@ -564,42 +564,13 @@ private:
|
||||||
mutable bool _non_deprecated_scan_api_used : 1;
|
mutable bool _non_deprecated_scan_api_used : 1;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool is_extended_advertising_enabled() {
|
bool is_extended_advertising_enabled();
|
||||||
return _pal_gap.is_feature_supported(pal::Gap::ControllerSupportedFeatures_t::LE_EXTENDED_ADVERTISING);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool get_adv_set_bit(const uint8_t *bytes, uint8_t bit_number) {
|
static bool get_adv_set_bit(const uint8_t *bytes, uint8_t bit_number);
|
||||||
if (bit_number > MAX_ADVERTISING_SETS) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
uint8_t byte = bit_number / 8;
|
|
||||||
uint8_t bit = bit_number - byte;
|
|
||||||
bytes += byte;
|
|
||||||
bool value = ((*bytes) >> bit) & 0x01;
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool set_adv_set_bit(uint8_t *bytes, uint8_t bit_number) {
|
static bool set_adv_set_bit(uint8_t *bytes, uint8_t bit_number);
|
||||||
if (bit_number > MAX_ADVERTISING_SETS) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
uint8_t byte = bit_number / 8;
|
|
||||||
uint8_t bit = bit_number - byte;
|
|
||||||
bytes += byte;
|
|
||||||
*bytes = *bytes | (0x01 >> bit);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool clear_adv_set_bit(uint8_t *bytes, uint8_t bit_number) {
|
static bool clear_adv_set_bit(uint8_t *bytes, uint8_t bit_number);
|
||||||
if (bit_number > MAX_ADVERTISING_SETS) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
uint8_t byte = bit_number / 8;
|
|
||||||
uint8_t bit = bit_number - byte;
|
|
||||||
bytes += byte;
|
|
||||||
*bytes = *bytes & (0x00 >> bit);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2042,5 +2042,45 @@ void GenericGap::use_non_deprecated_scan_api() const
|
||||||
_non_deprecated_scan_api_used = true;
|
_non_deprecated_scan_api_used = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GenericGap::is_extended_advertising_enabled()
|
||||||
|
{
|
||||||
|
return _pal_gap.is_feature_supported(
|
||||||
|
pal::Gap::ControllerSupportedFeatures_t::LE_EXTENDED_ADVERTISING
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GenericGap::get_adv_set_bit(const uint8_t *bytes, uint8_t bit_number) {
|
||||||
|
if (bit_number > MAX_ADVERTISING_SETS) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
uint8_t byte = bit_number / 8;
|
||||||
|
uint8_t bit = bit_number - byte;
|
||||||
|
bytes += byte;
|
||||||
|
bool value = ((*bytes) >> bit) & 0x01;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GenericGap::set_adv_set_bit(uint8_t *bytes, uint8_t bit_number) {
|
||||||
|
if (bit_number > MAX_ADVERTISING_SETS) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
uint8_t byte = bit_number / 8;
|
||||||
|
uint8_t bit = bit_number - byte;
|
||||||
|
bytes += byte;
|
||||||
|
*bytes = *bytes | (0x01 >> bit);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GenericGap::clear_adv_set_bit(uint8_t *bytes, uint8_t bit_number) {
|
||||||
|
if (bit_number > MAX_ADVERTISING_SETS) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
uint8_t byte = bit_number / 8;
|
||||||
|
uint8_t bit = bit_number - byte;
|
||||||
|
bytes += byte;
|
||||||
|
*bytes = *bytes & (0x00 >> bit);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace generic
|
} // namespace generic
|
||||||
} // namespace ble
|
} // namespace ble
|
||||||
|
|
Loading…
Reference in New Issue