Skip to content

Lorawan - fix for loop #207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/LoRaWan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ bool LoRaWanClass::transferPacket(char *buffer, unsigned char timeout)
while(SerialLoRa.available())SerialLoRa.read();

sendCommand("AT+MSG=\"");
for(unsigned char i = 0; i < length; i ++)SerialLoRa.write(buffer[i]);
for(int i = 0; i < length; i ++)SerialLoRa.write(buffer[i]);
sendCommand("\"\r\n");

while (true) {
Expand Down Expand Up @@ -303,7 +303,7 @@ bool LoRaWanClass::transferPacket(unsigned char *buffer, unsigned char length, u
while(SerialLoRa.available())SerialLoRa.read();

sendCommand("AT+MSGHEX=\"");
for(unsigned char i = 0; i < length; i ++)
for(int i = 0; i < length; i ++)
{
sprintf(temp,"%02x", buffer[i]);
SerialLoRa.write(temp);
Expand Down Expand Up @@ -331,7 +331,7 @@ bool LoRaWanClass::transferPacketWithConfirmed(char *buffer, unsigned char timeo
SerialLoRa.read();

sendCommand("AT+CMSG=\"");
for(unsigned char i = 0; i < length; i ++)SerialLoRa.write(buffer[i]);
for(int i = 0; i < length; i ++)SerialLoRa.write(buffer[i]);
sendCommand("\"\r\n");

#ifdef deadcode
Expand Down Expand Up @@ -390,7 +390,7 @@ bool LoRaWanClass::transferPacketWithConfirmed(unsigned char *buffer, unsigned c
while(SerialLoRa.available())SerialLoRa.read();

sendCommand("AT+CMSGHEX=\"");
for(unsigned char i = 0; i < length; i ++)
for(int i = 0; i < length; i ++)
{
sprintf(temp,"%02x", buffer[i]);
SerialLoRa.write(temp);
Expand Down Expand Up @@ -513,7 +513,7 @@ bool LoRaWanClass::transferProprietaryPacket(char *buffer, unsigned char timeout
while(SerialLoRa.available())SerialLoRa.read();

sendCommand("AT+PMSG=\"");
for(unsigned char i = 0; i < length; i ++)SerialLoRa.write(buffer[i]);
for(int i = 0; i < length; i ++)SerialLoRa.write(buffer[i]);
sendCommand("\"\r\n");

memset(_buffer, 0, BEFFER_LENGTH_MAX);
Expand All @@ -532,7 +532,7 @@ bool LoRaWanClass::transferProprietaryPacket(unsigned char *buffer, unsigned cha
while(SerialLoRa.available())SerialLoRa.read();

sendCommand("AT+PMSGHEX=\"");
for(unsigned char i = 0; i < length; i ++)
for(int i = 0; i < length; i ++)
{
sprintf(temp,"%02x", buffer[i]);
SerialLoRa.write(temp);
Expand Down Expand Up @@ -816,7 +816,7 @@ void LoRaWanClass::transferPacketP2PMode(char *buffer)
unsigned char length = strlen(buffer);

sendCommand("AT+TEST=TXLRSTR,\"");
for(unsigned char i = 0; i < length; i ++)SerialLoRa.write(buffer[i]);
for(int i = 0; i < length; i ++)SerialLoRa.write(buffer[i]);
sendCommand("\"\r\n");
}

Expand All @@ -825,7 +825,7 @@ void LoRaWanClass::transferPacketP2PMode(unsigned char *buffer, unsigned char le
char temp[2] = {0};

sendCommand("AT+TEST=TXLRPKT,\"");
for(unsigned char i = 0; i < length; i ++)
for(int i = 0; i < length; i ++)
{
sprintf(temp,"%02x", buffer[i]);
SerialLoRa.write(temp);
Expand Down Expand Up @@ -1042,4 +1042,4 @@ short LoRaWanClass::sendCommandAndWaitForResponse(char* command, char *response,
}


LoRaWanClass lora;
LoRaWanClass lora;