mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Fixed type for _dbm_signal and _dbm_noise
This commit is contained in:
@@ -182,13 +182,13 @@ namespace Tins {
|
|||||||
* \brief Setter for the dbm signal field.
|
* \brief Setter for the dbm signal field.
|
||||||
* \param new_dbm_signal The new dbm signal.
|
* \param new_dbm_signal The new dbm signal.
|
||||||
*/
|
*/
|
||||||
void dbm_signal(uint8_t new_dbm_signal);
|
void dbm_signal(int8_t new_dbm_signal);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Setter for the dbm noise field.
|
* \brief Setter for the dbm noise field.
|
||||||
* \param new_dbm_noise The new dbm noise.
|
* \param new_dbm_noise The new dbm noise.
|
||||||
*/
|
*/
|
||||||
void dbm_noise(uint8_t new_dbm_noise);
|
void dbm_noise(int8_t new_dbm_noise);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Setter for the signal quality field.
|
* \brief Setter for the signal quality field.
|
||||||
@@ -268,13 +268,13 @@ namespace Tins {
|
|||||||
* \brief Getter for the dbm signal field.
|
* \brief Getter for the dbm signal field.
|
||||||
* \return The dbm signal field.
|
* \return The dbm signal field.
|
||||||
*/
|
*/
|
||||||
uint8_t dbm_signal() const;
|
int8_t dbm_signal() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Getter for the dbm noise field.
|
* \brief Getter for the dbm noise field.
|
||||||
* \return The dbm noise field.
|
* \return The dbm noise field.
|
||||||
*/
|
*/
|
||||||
uint8_t dbm_noise() const;
|
int8_t dbm_noise() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Getter for the signal quality field.
|
* \brief Getter for the signal quality field.
|
||||||
@@ -429,7 +429,8 @@ namespace Tins {
|
|||||||
// present fields...
|
// present fields...
|
||||||
uint64_t _tsft;
|
uint64_t _tsft;
|
||||||
uint16_t _channel_type, _channel_freq, _rx_flags, _signal_quality;
|
uint16_t _channel_type, _channel_freq, _rx_flags, _signal_quality;
|
||||||
uint8_t _antenna, _flags, _rate, _dbm_signal, _dbm_noise, _channel, _max_power, _db_signal;
|
uint8_t _antenna, _flags, _rate, _channel, _max_power, _db_signal;
|
||||||
|
int8_t _dbm_signal, _dbm_noise;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -224,12 +224,12 @@ void RadioTap::channel(uint16_t new_freq, uint16_t new_type) {
|
|||||||
_channel_type = Endian::host_to_le(new_type);
|
_channel_type = Endian::host_to_le(new_type);
|
||||||
_radio.flags.channel = 1;
|
_radio.flags.channel = 1;
|
||||||
}
|
}
|
||||||
void RadioTap::dbm_signal(uint8_t new_dbm_signal) {
|
void RadioTap::dbm_signal(int8_t new_dbm_signal) {
|
||||||
_dbm_signal = new_dbm_signal;
|
_dbm_signal = new_dbm_signal;
|
||||||
_radio.flags.dbm_signal = 1;
|
_radio.flags.dbm_signal = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RadioTap::dbm_noise(uint8_t new_dbm_noise) {
|
void RadioTap::dbm_noise(int8_t new_dbm_noise) {
|
||||||
_dbm_noise = new_dbm_noise;
|
_dbm_noise = new_dbm_noise;
|
||||||
_radio.flags.dbm_noise = 1;
|
_radio.flags.dbm_noise = 1;
|
||||||
}
|
}
|
||||||
@@ -340,13 +340,13 @@ uint16_t RadioTap::channel_type() const {
|
|||||||
return Endian::le_to_host(_channel_type);
|
return Endian::le_to_host(_channel_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t RadioTap::dbm_signal() const {
|
int8_t RadioTap::dbm_signal() const {
|
||||||
if(!_radio.flags.dbm_signal)
|
if(!_radio.flags.dbm_signal)
|
||||||
throw field_not_present();
|
throw field_not_present();
|
||||||
return _dbm_signal;
|
return _dbm_signal;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t RadioTap::dbm_noise() const {
|
int8_t RadioTap::dbm_noise() const {
|
||||||
if(!_radio.flags.dbm_noise)
|
if(!_radio.flags.dbm_noise)
|
||||||
throw field_not_present();
|
throw field_not_present();
|
||||||
return _dbm_noise;
|
return _dbm_noise;
|
||||||
|
|||||||
Reference in New Issue
Block a user