![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Fork to see if I can get working
Dependencies: BufferedSerial OneWire WinbondSPIFlash libxDot-dev-mbed5-deprecated
Fork of xDotBridge_update_test20180823 by
Diff: xDotBridge/src/CommProtocolPeerBrute.cpp
- Revision:
- 81:1eb0f16b2ab9
- Parent:
- 75:600cb3a9f126
- Child:
- 89:edfe5d376e55
diff -r 73b7b2b3aabc -r 1eb0f16b2ab9 xDotBridge/src/CommProtocolPeerBrute.cpp --- a/xDotBridge/src/CommProtocolPeerBrute.cpp Wed Nov 15 00:25:42 2017 +0000 +++ b/xDotBridge/src/CommProtocolPeerBrute.cpp Thu Nov 16 20:59:24 2017 +0000 @@ -78,33 +78,33 @@ uint8_t tx_datarate; uint32_t tx_frequency; uint8_t frequency_band = dot->getFrequencyBand(); - switch (frequency_band) { - case mDot::FB_EU868: - // 250kHz channels achieve higher throughput - // DR6 : SF7 @ 250kHz - // DR0 - DR5 (125kHz channels) available but much slower - tx_frequency = 869850000; - tx_datarate = mDot::DR6; - // the 869850000 frequency is 100% duty cycle if the total power is under 7 dBm - tx power 4 + antenna gain 3 = 7 - tx_power = 4; - break; - case mDot::FB_US915: - case mDot::FB_AU915: - default: - // 500kHz channels achieve highest throughput - // DR8 : SF12 @ 500kHz - // DR9 : SF11 @ 500kHz - // DR10 : SF10 @ 500kHz - // DR11 : SF9 @ 500kHz - // DR12 : SF8 @ 500kHz - // DR13 : SF7 @ 500kHz - // DR0 - DR3 (125kHz channels) available but much slower - tx_frequency = 915500000; - tx_datarate = mDot::DR13; - // 915 bands have no duty cycle restrictions, set tx power to max - tx_power = 20; - break; - } +// switch (frequency_band) { +// case mDot::FB_EU868: +// // 250kHz channels achieve higher throughput +// // DR6 : SF7 @ 250kHz +// // DR0 - DR5 (125kHz channels) available but much slower +// tx_frequency = 869850000; +// tx_datarate = mDot::DR6; +// // the 869850000 frequency is 100% duty cycle if the total power is under 7 dBm - tx power 4 + antenna gain 3 = 7 +// tx_power = 4; +// break; +// case mDot::FB_US915: +// case mDot::FB_AU915: +// default: +// // 500kHz channels achieve highest throughput +// // DR8 : SF12 @ 500kHz +// // DR9 : SF11 @ 500kHz +// // DR10 : SF10 @ 500kHz +// // DR11 : SF9 @ 500kHz +// // DR12 : SF8 @ 500kHz +// // DR13 : SF7 @ 500kHz +// // DR0 - DR3 (125kHz channels) available but much slower +// tx_frequency = 915500000; +// tx_datarate = mDot::DR13; +// // 915 bands have no duty cycle restrictions, set tx power to max +// tx_power = 20; +// break; +// } // in PEER_TO_PEER mode there is no join request/response transaction // as long as both Dots are configured correctly, they should be able to communicate @@ -145,33 +145,33 @@ uint8_t tx_datarate; uint32_t tx_frequency; uint8_t frequency_band = dot->getFrequencyBand(); - switch (frequency_band) { - case mDot::FB_EU868: - // 250kHz channels achieve higher throughput - // DR6 : SF7 @ 250kHz - // DR0 - DR5 (125kHz channels) available but much slower - tx_frequency = 869850000; - tx_datarate = mDot::DR6; - // the 869850000 frequency is 100% duty cycle if the total power is under 7 dBm - tx power 4 + antenna gain 3 = 7 - tx_power = 4; - break; - case mDot::FB_US915: - case mDot::FB_AU915: - default: - // 500kHz channels achieve highest throughput - // DR8 : SF12 @ 500kHz - // DR9 : SF11 @ 500kHz - // DR10 : SF10 @ 500kHz - // DR11 : SF9 @ 500kHz - // DR12 : SF8 @ 500kHz - // DR13 : SF7 @ 500kHz - // DR0 - DR3 (125kHz channels) available but much slower - tx_frequency = 915500000; - tx_datarate = mDot::DR13; - // 915 bands have no duty cycle restrictions, set tx power to max - tx_power = 20; - break; - } +// switch (frequency_band) { +// case mDot::FB_EU868: +// // 250kHz channels achieve higher throughput +// // DR6 : SF7 @ 250kHz +// // DR0 - DR5 (125kHz channels) available but much slower +// tx_frequency = 869850000; +// tx_datarate = mDot::DR6; +// // the 869850000 frequency is 100% duty cycle if the total power is under 7 dBm - tx power 4 + antenna gain 3 = 7 +// tx_power = 4; +// break; +// case mDot::FB_US915: +// case mDot::FB_AU915: +// default: +// // 500kHz channels achieve highest throughput +// // DR8 : SF12 @ 500kHz +// // DR9 : SF11 @ 500kHz +// // DR10 : SF10 @ 500kHz +// // DR11 : SF9 @ 500kHz +// // DR12 : SF8 @ 500kHz +// // DR13 : SF7 @ 500kHz +// // DR0 - DR3 (125kHz channels) available but much slower +// tx_frequency = 915500000; +// tx_datarate = mDot::DR13; +// // 915 bands have no duty cycle restrictions, set tx power to max +// tx_power = 20; +// break; +// } update_peer_to_peer_config(pair_network_address, pair_network_session_key, pair_data_session_key, tx_frequency, tx_datarate, tx_power); dot->saveConfig(); // This is required for network settings to apply return cmdSuccess; @@ -537,9 +537,9 @@ myLogInfo("version ------------------ %s", dot->getId().c_str()); myLogInfo("device ID/EUI ------------ %s", mts::Text::bin2hexString(dot->getDeviceId()).c_str()); myLogInfo("frequency band ----------- %s", mDot::FrequencyBandStr(dot->getFrequencyBand()).c_str()); - if (dot->getFrequencySubBand() != mDot::FB_EU868) { - myLogInfo("frequency sub band ------- %u", dot->getFrequencySubBand()); - } +// if (dot->getFrequencySubBand() != mDot::FB_EU868) { +// myLogInfo("frequency sub band ------- %u", dot->getFrequencySubBand()); +// } myLogInfo("public network ----------- %s", dot->getPublicNetwork() ? "on" : "off"); myLogInfo("========================="); myLogInfo("credentials configuration");