RF69 - Added method to disable address filtering

pull/1/head
Jan Gromeš 2018-07-14 10:00:06 +02:00
rodzic 7c534527ef
commit cd7adc03d7
3 zmienionych plików z 20 dodań i 0 usunięć

Wyświetl plik

@ -32,6 +32,7 @@ HTTPClient KEYWORD1
# KiteLib
ModuleA KEYWORD2
ModuleB KEYWORD2
Module KEYWORD2
# SX1272/73/76/77/78/79 + RF69
dataRate KEYWORD2
@ -54,6 +55,7 @@ setRxBandwidth KEYWORD2
setFrequencyDeviation KEYWORD2
setNodeAddress KEYWORD2
setBroadcastAddress KEYWORD2
disableAddressFiltering KEYWORD2
# ESP8266
join KEYWORD2

Wyświetl plik

@ -433,6 +433,23 @@ uint8_t RF69::setBroadcastAddress(uint8_t broadAddr) {
return(_mod->SPIsetRegValue(RF69_REG_BROADCAST_ADRS, broadAddr));
}
uint8_t RF69::disableAddressFiltering() {
// disable address filtering
uint8_t state = _mod->SPIsetRegValue(RF69_REG_PACKET_CONFIG_1, RF69_ADDRESS_FILTERING_OFF, 2, 1);
if(state != ERR_NONE) {
return(state);
}
// set node address to default (0x00)
state = _mod->SPIsetRegValue(RF69_REG_NODE_ADRS, 0x00);
if(state != ERR_NONE) {
return(state);
}
// set broadcast address to default (0x00)
return(_mod->SPIsetRegValue(RF69_REG_BROADCAST_ADRS, 0x00));
}
uint8_t RF69::config() {
uint8_t state = ERR_NONE;

Wyświetl plik

@ -436,6 +436,7 @@ class RF69 {
uint8_t setSyncWord(uint8_t* syncWord, size_t len, uint8_t maxErrBits = 0);
uint8_t setNodeAddress(uint8_t nodeAddr);
uint8_t setBroadcastAddress(uint8_t broadAddr);
uint8_t disableAddressFiltering();
protected:
Module* _mod;