Some dependency pleanup

This commit is contained in:
Pawel Spychalski
2018-05-23 14:15:22 +02:00
parent 917b1514fd
commit bb2317b06a
9 changed files with 99 additions and 54 deletions

View File

@@ -68,7 +68,8 @@ uint32_t RadioNode::getChannelEntryMillis(void) {
void RadioNode::readAndDecode(
QspConfiguration_t *qsp,
RxDeviceState_t *rxDeviceState,
TxDeviceState_t *txDeviceState
TxDeviceState_t *txDeviceState,
uint8_t bindKey[]
) {
uint8_t tmpBuffer[MAX_PACKET_SIZE];
/*
@@ -78,7 +79,7 @@ void RadioNode::readAndDecode(
LoRa.read(tmpBuffer, bytesToRead);
for (int i = 0; i < bytesToRead; i++) {
qspDecodeIncomingFrame(qsp, tmpBuffer[i], rxDeviceState, txDeviceState);
qspDecodeIncomingFrame(qsp, tmpBuffer[i], rxDeviceState, txDeviceState, bindKey);
}
//After reading, flush radio buffer, we have no need for whatever might be over there
@@ -144,7 +145,7 @@ void RadioNode::handleTxDoneState(bool hop) {
}
}
void RadioNode::handleTx(QspConfiguration_t *qsp) {
void RadioNode::handleTx(QspConfiguration_t *qsp, uint8_t bindKey[]) {
if (!canTransmit) {
return;
@@ -155,7 +156,7 @@ void RadioNode::handleTx(QspConfiguration_t *qsp) {
LoRa.beginPacket();
//Prepare packet
qspEncodeFrame(qsp, tmpBuffer, &size, getChannel());
qspEncodeFrame(qsp, tmpBuffer, &size, getChannel(), bindKey);
//Sent it to radio in one SPI transaction
LoRa.write(tmpBuffer, size);
LoRa.endPacketAsync();