@@ -34,7 +34,7 @@ inline double dbmToPow(double x) { return 0.001 * pow(10., x / 10.); }
34
34
inline double QPSKPowerToBER (double P, double N) { return erfc (sqrt (P / N)); }
35
35
36
36
// ///////////////////////////////////////////
37
- std::tuple<bool , double >
37
+ std::tuple<bool , double , bool >
38
38
attempt_send (const radio_configuration& radio,
39
39
rf_interface::radio_state& tx_state,
40
40
rf_interface::radio_state& rx_state,
@@ -68,17 +68,19 @@ attempt_send(const radio_configuration& radio,
68
68
{
69
69
// ignwarn << "Bitrate limited: " << bits_sent << "bits sent (limit: "
70
70
// << radio.capacity * epoch_duration.toSec() << std::endl;
71
- return std::make_tuple (false , std::numeric_limits<double >::lowest ());
71
+ return std::make_tuple (false , std::numeric_limits<double >::lowest (), false );
72
72
}
73
73
74
74
// Record these bytes
75
75
tx_state.bytes_sent .push_back (std::make_pair (now, num_bytes));
76
76
tx_state.bytes_sent_this_epoch += num_bytes;
77
77
78
78
// Get the received power based on TX power and position of each node
79
+ bool usingBreadcrumbs;
79
80
auto rx_power_dist = radio.pathloss_f (radio.default_tx_power ,
80
81
tx_state,
81
- rx_state);
82
+ rx_state,
83
+ usingBreadcrumbs);
82
84
83
85
double rx_power = rx_power_dist.mean ;
84
86
if (rx_power_dist.variance > 0.0 ) {
@@ -113,7 +115,7 @@ attempt_send(const radio_configuration& radio,
113
115
bool packet_received = rand_draw > packet_drop_prob;
114
116
115
117
if (!packet_received)
116
- return std::make_tuple (false , std::numeric_limits<double >::lowest ());
118
+ return std::make_tuple (false , std::numeric_limits<double >::lowest (), false );
117
119
118
120
// Maintain running window of bytes received over the last epoch, e.g.,
119
121
// 1s
@@ -140,14 +142,14 @@ attempt_send(const radio_configuration& radio,
140
142
// ignwarn < <"Bitrate limited: " << bits_received
141
143
// << "bits received (limit: " << radio.capacity * epoch_duration.toSec()
142
144
// << )\n";
143
- return std::make_tuple (false , std::numeric_limits<double >::lowest ());
145
+ return std::make_tuple (false , std::numeric_limits<double >::lowest (), false );
144
146
}
145
147
146
148
// Record these bytes
147
149
rx_state.bytes_received .push_back (std::make_pair (now, num_bytes));
148
150
rx_state.bytes_received_this_epoch += num_bytes;
149
151
150
- return std::make_tuple (true , rx_power);
152
+ return std::make_tuple (true , rx_power, usingBreadcrumbs );
151
153
}
152
154
153
155
}
0 commit comments