Funtion not found in library

Hello,

I am new to Arduino.

I recently bought a Seeeduino LoraWAN w/GPS that includes the "LoRaWAN.h" library in its examples.

One of these examples uses the function lora.transferPacket which I cannot find in either "LoRaWAN.h" or "LoRaWAN.cpp".

How can I determine where this function comes from and its limitations or alternatives. Specifically, it seems to be limited to transmitting packets no larger than 10 bytes. I need to transmit 19 bytes and the function returns an error of "length" when I increase packet size.

I cannot find any documentation on the library anywhere. I would appreciate any help on the matter, specially some way of knowing how to determine where specific functions come from.

I am leaving my sketch below and attaching the libraries:

#include "TinyGPS++.h"

#include "LoRaWan.h"

#include "LoRa.h"

//unsigned char data[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA,};
//unsigned char data[10] = "Hey World";
//unsigned char data = 1;
unsigned char frame_counter = 1;
char buffer[256];

TinyGPSPlus gps;

float latitude;
float longitude;
int alt;
uint8_t buffer1[11];

void setup() {

Serial.begin(9600);

SerialUSB.begin(115200);
while(!SerialUSB);

lora.init();
lora.setDeviceDefault();

memset(buffer, 0, 256);
lora.getVersion(buffer, 256, 1);
SerialUSB.print(buffer);

memset(buffer, 0, 256);
lora.getId(buffer, 256, 1);
SerialUSB.print(buffer);

//void setId(char *DevAddr, char *DevEUI, char *AppEUI);
//void setKey(char *NwkSKey, char *AppSKey, char *AppKey);

lora.setId("0092FA68", NULL, NULL);
lora.setKey("FE9C7DA13158C50F48B6E257F7BEECF9", "E05BA10A753208A73F8EEB6503E9743F", NULL);

lora.setDeciveMode(LWABP);
lora.setDataRate(DR0, US915HYBRID);

for(uint8_t i = 0; i < 72; i ++)lora.setChannel(i, 0);

lora.setChannel(0, 902.3, DR0, DR3);
lora.setChannel(1, 902.5, DR0, DR3);
lora.setChannel(2, 902.7, DR0, DR3);
lora.setChannel(3, 902.9, DR0, DR3);
lora.setChannel(4, 903.1, DR0, DR3);
lora.setChannel(5, 903.3, DR0, DR3);
lora.setChannel(6, 903.5, DR0, DR3);
lora.setChannel(7, 903.7, DR0, DR3);

lora.setReceiceWindowFirst(1);
lora.setReceiceWindowSecond(923.3, DR8);

lora.setPower(14);

latitude = 19.3974;
longitude = -99.1629;
alt = 2200;

int32_t lat = latitude * 10000;
int32_t lon = longitude * 10000;
int32_t altt = alt;

buffer1[0] = 1;
buffer1[1] = 136;
buffer1[2] = lat >> 16;
buffer1[3] = lat >> 8;
buffer1[4] = lat;
buffer1[5] = lon >> 16;
buffer1[6] = lon >> 8;
buffer1[7] = lon;
buffer1[8] = 3;
buffer1[9] = 133;
buffer1[10] = 144;
/buffer1[11] = 2;
buffer1[12] = 2;
buffer1[13] = 1;
buffer1[14] = 145;
buffer1[15] = 3;
buffer1[16] = 103;
buffer1[17] = 1;
buffer1[18] = 74;
/

}

void loop() {

LoRa.transferPacket(buffer1, 11);

delay(180000);

/*while(Serial.available()){

gps.encode(Serial.read());

}

if (gps.altitude.isUpdated()){

SerialUSB.println(gps.altitude.meters());

}*/
}

Thanks!!

LoRaWAN.cpp (9.54 KB)

LoRaWAN.h (933 Bytes)

Where did you find that library? It's the wrong one. In fact it doesn't even have the same name. Note LoRaWan vs. LoRaWAN.

The LoRaWan library that code is written for is part of the Seeeduino SAMD hardware package that you install following these instructions:

It does indeed contain the transferPacket() function and there is some limited documentation in LoRaWan.h:

        /**
         *  \brief Transfer the data
         *  
         *  \param [in] *buffer The transfer data cache
         *  \param [in] timeout The over time of transfer
         *  
         *  \return Return bool. Ture : transfer done, false : transfer failed
         */
        bool transferPacket(char *buffer, unsigned char timeout = DEFAULT_TIMEOUT);
        /**
         *  \brief Transfer the data
         *  
         *  \param [in] *buffer The transfer data cache
         *  \param [in] length The length of data cache
         *  \param [in] timeout The over time of transfer
         *  
         *  \return Return bool. Ture : transfer done, false : transfer failed
         */
        bool transferPacket(unsigned char *buffer, unsigned char length, unsigned char timeout = DEFAULT_TIMEOUT);