Lib Questions RAK11300

@beegee

For the RAK 11300 I have some qustions about your LoRaWAN library:

#define LORAWAN_CONFIRMED_MSG_ON 0

Does this need to be set to 1 to switch on. Does this only effect uplink or downlink as well?

#define LORAWAN_CERTIF_PORT 224 /**< LoRaWAN certification port */

What is this and should it be set to a different value as the note says not to use port 224?

#define LORAWAN_APP_PORT 2 /**< LoRaWAN application port,

This is the port data is sent to the device on.

#define LORAWAN_APP_DATA_MAX_SIZE 242 /**< LoRaWAN User application data buffer size*/

Is the RX or TX data buffer?

#define LORAWAN_DEFAULT_DATARATE DR_3 /**< LoRaWAN Default datarate*/

Default Data Rate - Is the full range supported. I.E 0-15

Later in your example you define:

#define LORAWAN_DATERATE DR_5

Does this overide the default DR_3 ?

#define LORAWAN_DEFAULT_TX_POWER TX_POWER_0 /**< LoRaWAN Default tx power*/

What is the range of values supported here and how does it map to output power?

Thank you

Please don’t mess around with these defines.There are API calls for these.The defines will be in most cases overruled by settings defined by the LoRaWAN region or by API calls.,

#define LORAWAN_CONFIRMED_MSG_ON 0

Use _lmh_error_status lmh_send(lmh_app_data_t *app_data, lmh_confirm is_txconfirmed); to send confirmed or unconfirmed. This is for uplinks only. For confirmed downlinks, you have to set it in the LNS when initiating the downlink.

#define LORAWAN_APP_PORT 2 /**< LoRaWAN application port,

Set the fPort in the structure lmh_app_data_t when sending data with lmh_error_status lmh_send(lmh_app_data_t *app_data, lmh_confirm is_txconfirmed);

/**@brief Application Data structure
 */
typedef struct
{
	uint8_t *buffer;  /**< point to the LoRa App data buffer */
	uint8_t buffsize; /**< LoRa App data buffer size */
	uint8_t port;	  /**< Port on which the LoRa App is data is sent/ received */
	int16_t rssi;
	uint8_t snr;
} lmh_app_data_t;

#define LORAWAN_APP_DATA_MAX_SIZE 242 /**< LoRaWAN User application data buffer size*/

It is TX or RX, it is not the buffer, just the maximum size.

#define LORAWAN_DEFAULT_DATARATE DR_3 /**< LoRaWAN Default datarate*/
#define LORAWAN_DATERATE DR_5

Is not used. Default datarate depends on LoRaWAN region. Used datarate is set with void lmh_datarate_set(uint8_t data_rate, bool enable_adr);

#define LORAWAN_DEFAULT_TX_POWER TX_POWER_0 /**< LoRaWAN Default tx power*/

Range depends on the LoRaWAN region, max is 0 (max power) to 10 (min power).
See TX Power by Region.
To change TX power use void lmh_tx_power_set(uint8_t tx_power);


#define LORAWAN_CERTIF_PORT 224 /**< LoRaWAN certification port */

Is only used for LoRa Alliance certification tests. Not used in daily usage.