int8_t PhyLayer::ComputeRssi(PhyDevice::Identifier /*sender_id*/,
PhyDevice::Identifier /*receiver_id*/, int8_t /*tx_power*/) { // Perform no RSSI computation by default. // Clients overriding this function should use the TX power and // positional information to derive correct device-to-device RSSI. static uint8_t rssi = 0;
rssi = (rssi + 5) % 128; returnstatic_cast<int8_t>(-rssi);
}
void PhyLayer::Send(std::vector<uint8_t> const& packet, int8_t tx_power,
PhyDevice::Identifier sender_id) { for (constauto& device : phy_devices_) { // Do not send the packet back to the sender. if (sender_id != device->id) {
device->Receive(packet, type, ComputeRssi(sender_id, device->id, tx_power));
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.