BLE & LTE-M Gateway Base Library

Description

Basic library for the BLE & LTE-M Gateway hardware platform.

Overview

Abstract:
Supported rapidM2M hardware platforms:
  • rapidM2M BLEGW (BLE-only/Cellular):
    • Firmware: 01v026 and higher
If you use this library in your IoT app, you should specify the minimum required version of the firmware under "required HW & FW" in the project settings.
The runtime estimation stores up to RTE_COUNTDATA SoC changes and calculate after each change a new estimation for how many seconds the device could run on constant current consumption.
Runtime Estimation is not available for devices with removable batteries (rapidM2M BLEGW world).
It is possible that there occur problems after time synchronisation.
Runtime Estimation is just on a valid site context available.
How to use - Recommended use of the Library
#callback HandleTimer() { new runtime = RTE_Predict_RuntimeDays(); #log("Runtime = %d days", runtime); } #callback init() { #log("Init done!"); RTE_Init(); } main() { salve(init); setInterval(HandleTimer, 1000); }

BASIC

RTE_Init()

Initializes the runtime estimation

returns : s32
OK
ERROR-1 - If runtime prediction is not supported.
RTE_Close()

Close and reset the runtime estimation.

returns : s32
OK
ERROR-1 - If runtime prediction is not supported.
RTE_Restart()

Restart internal timer and calculation.

returns : s32
OK
ERROR-1 - If runtime prediction is not supported.
RTE_Stop()

Stop internal timer and calculation. Used to stop the calculation in some szenarios more or less power consumption is used.

returns : s32
OK
ERROR-1 - If runtime prediction is not supported.
RTE_Predict_RuntimeSeconds()

Predict the runtime to 0% SOC. A valid site context is required.

returns : s32
iRuntime - Runtime prediction in seconds.
ERROR - If error in calculation.
ERROR-1 - If runtime prediction is not supported.
RTE_Predict_RuntimeDays()

Predict the runtime to 0% SOC. A valid site context is required.

returns : s32
iRuntime - Runtime prediction in days.
ERROR - If error in calculation.
ERROR-1 - If runtime prediction is not supported.

EXPERT

Data Count:
To override the data count add the following block to the main.dde file.
/** --------------------------------------------------------------------------- * blegw-base-mt: Data Count for runtime estimation * ----------------------------------------------------------------------------- * * Use this block to configure the data count: * * This value determine how many data points are stored for runtime estimation * By default 200 * > 0 */ #define RTE_COUNTDATA XXX
Debug Config:
To configure debug mode add the following block to the main.dde file.
/** --------------------------------------------------------------------------- * blegw-base-mt: Debug Config for runtime estimation * ----------------------------------------------------------------------------- * * Use this block to configure the debug mode: * * 0: No outputs * 1: Extended debug outputs via console outputs */ #define RTE_DEBUG 0

On this page

BLE & LTE-M Gateway Base Library