Fixed missing cr statement for RNodeInterface

This commit is contained in:
Mark Qvist 2020-05-27 16:47:12 +02:00
parent fd010fa80c
commit 0d069bf1d8

View File

@ -68,7 +68,6 @@ class RNodeInterface(Interface):
FREQ_MAX = 1020000000 FREQ_MAX = 1020000000
RSSI_OFFSET = 157 RSSI_OFFSET = 157
SNR_OFFSET = 128
CALLSIGN_MAX_LEN = 32 CALLSIGN_MAX_LEN = 32
@ -193,6 +192,7 @@ class RNodeInterface(Interface):
self.setBandwidth() self.setBandwidth()
self.setTXPower() self.setTXPower()
self.setSpreadingFactor() self.setSpreadingFactor()
self.setCodingRate()
self.setRadioState(KISS.RADIO_STATE_ON) self.setRadioState(KISS.RADIO_STATE_ON)
def setFrequency(self): def setFrequency(self):
@ -221,7 +221,6 @@ class RNodeInterface(Interface):
def setTXPower(self): def setTXPower(self):
txp = bytes([self.txpower]) txp = bytes([self.txpower])
kiss_command = bytes([KISS.FEND])+bytes([KISS.CMD_TXPOWER])+txp+bytes([KISS.FEND]) kiss_command = bytes([KISS.FEND])+bytes([KISS.CMD_TXPOWER])+txp+bytes([KISS.FEND])
written = self.serial.write(kiss_command) written = self.serial.write(kiss_command)
if written != len(kiss_command): if written != len(kiss_command):
@ -229,7 +228,6 @@ class RNodeInterface(Interface):
def setSpreadingFactor(self): def setSpreadingFactor(self):
sf = bytes([self.sf]) sf = bytes([self.sf])
kiss_command = bytes([KISS.FEND])+bytes([KISS.CMD_SF])+sf+bytes([KISS.FEND]) kiss_command = bytes([KISS.FEND])+bytes([KISS.CMD_SF])+sf+bytes([KISS.FEND])
written = self.serial.write(kiss_command) written = self.serial.write(kiss_command)
if written != len(kiss_command): if written != len(kiss_command):
@ -237,7 +235,6 @@ class RNodeInterface(Interface):
def setCodingRate(self): def setCodingRate(self):
cr = bytes([self.cr]) cr = bytes([self.cr])
kiss_command = bytes([KISS.FEND])+bytes([KISS.CMD_CR])+cr+bytes([KISS.FEND]) kiss_command = bytes([KISS.FEND])+bytes([KISS.CMD_CR])+cr+bytes([KISS.FEND])
written = self.serial.write(kiss_command) written = self.serial.write(kiss_command)
if written != len(kiss_command): if written != len(kiss_command):