[CC1101] PQT = 0 in setPromiscuous (#1033)

* PQT = 0 in setPromiscuous

* Carriersense in promiscuous

* carriersense to promiscuous

* Fix explanation
This commit is contained in:
Crsarmv7l 2024-03-26 02:24:02 -04:00 committed by GitHub
parent 648b455cff
commit b3ed84a035
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View file

@ -826,7 +826,7 @@ int16_t CC1101::setCrcFiltering(bool enable) {
}
}
int16_t CC1101::setPromiscuousMode(bool enable) {
int16_t CC1101::setPromiscuousMode(bool enable, bool requireCarrierSense) {
int16_t state = RADIOLIB_ERR_NONE;
if(this->promiscuous == enable) {
@ -834,9 +834,14 @@ int16_t CC1101::setPromiscuousMode(bool enable) {
}
if(enable) {
// Lets set PQT to 0 with Promiscuous too
// We have to set the length to set PQT, but it should get disabled with disableSyncWordFiltering()
state = setPreambleLength(16, 0);
RADIOLIB_ASSERT(state);
// disable sync word filtering and insertion
// this also disables preamble
state = disableSyncWordFiltering();
// Can enable Sync Mode with carriersense when promiscuous is enabled. Default is false: Sync Mode None
state = disableSyncWordFiltering(requireCarrierSense);
RADIOLIB_ASSERT(state);
// disable CRC filtering

View file

@ -874,9 +874,10 @@ class CC1101: public PhysicalLayer {
/*!
\brief Set modem in "sniff" mode: no packet filtering (e.g., no preamble, sync word, address, CRC).
\param enable Set or unset promiscuous mode.
\param defaults to false: no carriersense, true: sets carriersense above threshold
\returns \ref status_codes
*/
int16_t setPromiscuousMode(bool enable = true);
int16_t setPromiscuousMode(bool enable = true, bool requireCarrierSense = false);
/*!
\brief Get whether the modem is in promiscuous mode: no packet filtering