Skip to content

Commit 8217eba

Browse files
committed
Add setLoRaPayloadLength() method
1 parent 8a1c1e3 commit 8217eba

5 files changed

Lines changed: 19 additions & 14 deletions

File tree

LoRaRF/SX126x.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class SX126x :
301301
_ldro = LORA_LDRO_OFF
302302
_headerType = LORA_HEADER_EXPLICIT
303303
_preambleLen = 12
304-
_payLoadLen = 32
304+
_payLoadLength = 32
305305
_crcType = LORA_CRC_ON
306306
_invertIq = LORA_IQ_STANDARD
307307

@@ -499,6 +499,11 @@ def setLoRaPacket(self, headerType, preambleLength, payloadLength, crcType=LORA_
499499
self._setPacketParamsLoRa(preambleLength, headerType, payloadLength, crcType, invertIq)
500500
self._fixInvertedIq(invertIq)
501501

502+
def setLoRaPayloadLength(self, payloadLength) :
503+
self._payloadLength
504+
self._setPacketParamsLoRa(self._preambleLength, self._headerType, payloadLength, self._crcType, self._invertIq)
505+
self._fixInvertedIq(self._invertIq)
506+
502507
def setLoRaSyncWord(self, sw) :
503508
buf = [
504509
(sw >> 8) & 0xFF,

examples/SX126x_receiver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import os, sys
2-
currentdir = os.path.dirname(os.path.realpath(__file__))
3-
parentdir = os.path.dirname(currentdir)
4-
sys.path.append(parentdir)
1+
# import os, sys
2+
# currentdir = os.path.dirname(os.path.realpath(__file__))
3+
# parentdir = os.path.dirname(currentdir)
4+
# sys.path.append(parentdir)
55
from LoRaRF import SX126x
66
from LoRaRF import LoRaIO
77
import time

examples/SX126x_simple_gateway.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import os, sys
2-
currentdir = os.path.dirname(os.path.realpath(__file__))
3-
parentdir = os.path.dirname(currentdir)
4-
sys.path.append(parentdir)
1+
# import os, sys
2+
# currentdir = os.path.dirname(os.path.realpath(__file__))
3+
# parentdir = os.path.dirname(currentdir)
4+
# sys.path.append(parentdir)
55
from LoRaRF import SX126x
66
from LoRaRF import LoRaIO
77
import time

examples/SX126x_simple_node.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import os, sys
2-
currentdir = os.path.dirname(os.path.realpath(__file__))
3-
parentdir = os.path.dirname(currentdir)
4-
sys.path.append(parentdir)
1+
# import os, sys
2+
# currentdir = os.path.dirname(os.path.realpath(__file__))
3+
# parentdir = os.path.dirname(currentdir)
4+
# sys.path.append(parentdir)
55
from LoRaRF import SX126x
66
from LoRaRF import LoRaIO
77
import time

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = LoRaRF
3-
version = 1.1.0
3+
version = 1.1.1
44
author = Chandra Wijaya Sentosa
55
author_email = chandra.w.sentosa@gmail.com
66
description = Python library used for basic transmitting and receiving data using LoRa modem

0 commit comments

Comments
 (0)