Onethinx LoRaWAN Functions.
More...
|
| coreStatus_t | LoRaWAN_Reset (void) |
| | This function forces the current non-blocking function to stop. More...
|
| |
| coreStatus_t | LoRaWAN_Init (coreConfiguration_t *coreConfigurationPtr) |
| | Initializes the LoRaWAN stack and points the stack to the location of the settings. More...
|
| |
| coreStatus_t | LoRaWAN_GetInfo (coreInfo_t *coreInfo) |
| | This function gives the stack information which were saved at the time of the programming. More...
|
| |
| coreStatus_t | LoRaWAN_Join (WaitMode_e waitMode) |
| | Joins the LoRaWAN network, taking the parameters from the coreConfiguration structure which was passed to LoRaWAN_Init. More...
|
| |
| coreStatus_t | LoRaWAN_FlashRead (uint8_t *buffer, uint8_t block, uint8_t length) |
| | This function reads the buffer that was previously saved to flash. More...
|
| |
| coreStatus_t | LoRaWAN_FlashWrite (uint8_t *buffer, uint8_t block, uint8_t length) |
| | This function saves a buffer to flash. More...
|
| |
| coreStatus_t | LoRaWAN_SetDateTime (dateTime_t *dt) |
| | This function allows the user to set the current date and time. More...
|
| |
| coreStatus_t | LoRaWAN_GetDateTime (dateTime_t *dt) |
| | This function allows the user to get the current date and time. More...
|
| |
| coreStatus_t | LoRaWAN_GetRXdata (uint8_t *RXdata, uint8_t length) |
| | This function retrieves the specified length of data reveived via downlink from a gateway and saves it to a buffer. More...
|
| |
| coreStatus_t | LoRaWAN_Send (uint8_t *buffer, uint8_t length, WaitMode_e waitMode) |
| | This function sends your buffer of data to the LoRaWAN network. More...
|
| |
| coreStatus_t | LoRaWAN_SendMac (uint8_t *buffer, uint8_t length, WaitMode_e waitMode, MACcmd_e MACcmd) |
| | This function sends your buffer of data and a MAC command to the LoRaWAN network. More...
|
| |
| coreStatus_t | LoRaWAN_Sleep (sleepConfig_t *sleepConfig) |
| | This function allows you to enter a sleep mode. More...
|
| |
| coreStatus_t | LoRaWAN_GetStatus () |
| | This function returns the current error /status. More...
|
| |
| errorStatus_t | LoRaWAN_GetError () |
| | This function returns the current error /status. More...
|
| |
Onethinx LoRaWAN Functions.
◆ LoRaWAN_FlashRead()
| coreStatus_t LoRaWAN_FlashRead |
( |
uint8_t * |
buffer, |
|
|
uint8_t |
block, |
|
|
uint8_t |
length |
|
) |
| |
This function reads the buffer that was previously saved to flash.
This allows user to access the buffer even if reset or power off occures.
| Block | Data |
| 0 | Max 256 bytes |
| 1 | Max 256 bytes |
| 2 | Max 256 bytes |
| 3 | Max 256 bytes |
| 4 | Max 256 bytes |
| 5 | Max 256 bytes |
| 6 | Max 256 bytes |
| 7 | Max 256 bytes |
- Parameters
-
| buffer | Pointer to the buffer where the data read from flash will be saved to. |
| block | Block from which the data is read from. Available blocks: 0 to 7 |
| length | Length of data which you wish to read. Maximum 255 bytes. |
- Returns
- Returns error / status code.
- See also
- LoRaWAN_FlashWrite and coreStatus_t
◆ LoRaWAN_FlashWrite()
| coreStatus_t LoRaWAN_FlashWrite |
( |
uint8_t * |
buffer, |
|
|
uint8_t |
block, |
|
|
uint8_t |
length |
|
) |
| |
This function saves a buffer to flash.
This allows user to access the buffer even if reset or power off occures.
| Block | Data |
| 0 | Max 256 bytes |
| 1 | Max 256 bytes |
| 2 | Max 256 bytes |
| 3 | Max 256 bytes |
| 4 | Max 256 bytes |
| 5 | Max 256 bytes |
| 6 | Max 256 bytes |
| 7 | Max 256 bytes |
- Parameters
-
| buffer | Pointer to the data which needs to be saved. |
| block | Block to which the data should be saved to. Available blocks: 0 to 7 |
| length | Length of data which you wish saved. Maximum 255 bytes. |
- Returns
- Returns error / status code.
- See also
- LoRaWAN_FlashRead and coreStatus_t
◆ LoRaWAN_GetDateTime()
This function allows the user to get the current date and time.
- Parameters
-
| dt | Point to the location where date and time data is saved. |
- Returns
- Returns error / status code.
- See also
- dateTime_t and coreStatus_t
◆ LoRaWAN_GetError()
This function returns the current error /status.
- Returns
- Returns error codes.
- See also
- errorStatus_t
◆ LoRaWAN_GetInfo()
This function gives the stack information which were saved at the time of the programming.
- Parameters
-
| coreInfo | Pointer to the location where info will be saved. |
- Returns
- Returns error / status code. (coreStatus_t)
◆ LoRaWAN_GetRXdata()
| coreStatus_t LoRaWAN_GetRXdata |
( |
uint8_t * |
RXdata, |
|
|
uint8_t |
length |
|
) |
| |
This function retrieves the specified length of data reveived via downlink from a gateway and saves it to a buffer.
The lenght of data can be retrieved after a succesful LoRaWAN_Send, through the status structure it returns
- Parameters
-
| RXdata | Pointer to the byte buffer to which the data is retrieved to. |
| length | Length of data which you wish saved. The length of data received can be seen after LoRaWAN_Send in coreStatus.mac.bytesToRead |
- Returns
- Returns error / status code.
- See also
- LoRaWAN_Send and coreStatus_t
◆ LoRaWAN_GetStatus()
This function returns the current error /status.
- Returns
- Returns error / status code. (coreStatus_t)
◆ LoRaWAN_Init()
Initializes the LoRaWAN stack and points the stack to the location of the settings.
- Parameters
-
| coreConfigurationPtr | Pointer to the structure where LoRaWAN parameters are set. |
- Returns
- Returns error / status code. (coreStatus_t)
◆ LoRaWAN_Join()
Joins the LoRaWAN network, taking the parameters from the coreConfiguration structure which was passed to LoRaWAN_Init.
- Parameters
-
| waitMode | Type of wait mode that the microcontroller core should wait in. |
| Mode | Description |
| M4_NoWait | Non-blocking. Do not wait untill stack is finished, M4 continues with operation. |
| M4_WaitActive | Blocking. Wait while stack busy, M4 stays in Active mode. |
| M4_WaitSleep | Blocking. Wait while stack busy, M4 goes into Sleep while is stack busy. |
| M4_WaitDeepSleep | Blocking. Wait while stack busy, M4 goes into DeepSleep while is stack busy. |
- Returns
- Returns error / status code.
- See also
- WaitMode_e and coreStatus_t
◆ LoRaWAN_Reset()
This function forces the current non-blocking function to stop.
Functions which receive waitMode_t can be set at both blocking and non-blocking.
- Returns
- Returns error / status code. (coreStatus_t)
◆ LoRaWAN_Send()
This function sends your buffer of data to the LoRaWAN network.
- Parameters
-
| buffer | Pointer to the data which needs to be sent. |
| length | Length of data which you wish to send. |
| waitMode | Type of wait mode that the microcontroller core should wait in. |
- Returns
- Returns error / status code. (coreStatus_t)
- See also
- WaitMode_e and coreStatus_t
◆ LoRaWAN_SendMac()
This function sends your buffer of data and a MAC command to the LoRaWAN network.
It is similar to LoRaWAN_Send, but this also sends a MAC command.
- Parameters
-
| buffer | Pointer to the data which needs to be sent. |
| length | Length of data which you wish to send. |
| waitMode | Type of wait mode that the microcontroller core should wait in. |
| MACcmd | MAC command to be sent to the LoRaWAN network. |
- See also
- WaitMode_e, MACcmd_e and coreStatus_t
◆ LoRaWAN_SetDateTime()
This function allows the user to set the current date and time.
- Parameters
-
| dt | Point to the location where date and time data is saved. |
- Returns
- Returns error / status code.
- See also
- dateTime_t and coreStatus_t
◆ LoRaWAN_Sleep()
This function allows you to enter a sleep mode.
- Parameters
-
| sleepConfig | Pointer to the sleep configuration structure. |
- Returns
- Returns error / status code.
- See also
- sleepConfig_t and coreStatus_t