Standard library for the rapidM2M Studio ecosphere
#options
is only allowed on the very top of /dlo/main.p
and does not support conditional compilation (#if,..)encoding=
and compiler=
similar to #ifdef
shorthand for
#if defined defname
shorthand for
#if !defined defname
shorthand for
#elseif defined defname
shorthand for
#elseif !defined defname
load an application specific file
load an application specific file ahead of imported libraries
Standard library for the rapidM2M Studio ecosphere
CP-1252 | Unicode | CP-1252 | Unicode | CP-1252 | Unicode | CP-1252 | Unicode | |||
---|---|---|---|---|---|---|
0x80 U+20ac | 0x88 U+02c6 ‰ | 0x90 ? | 0x98 U+02dc ™ | |||
0x81 ? | 0x89 U+2030 Š | 0x91 U+2018 ’ | 0x99 U+2122 š | |||
0x82 U+201a ƒ | 0x8a U+0160 ‹ | 0x92 U+2019 “ | 0x9a U+0161 › | |||
0x83 U+0192 „ | 0x8b U+2039 Œ | 0x93 U+201c ” | 0x9b U+203a œ | |||
0x84 U+201e … | 0x8c U+0152 Ž | 0x94 U+201d • | 0x9c U+0153 ž | |||
0x85 U+2026 † | 0x8d ? | 0x95 U+2022 – | 0x9d ? | |||
0x86 U+2020 ‡ | 0x8e U+017d | 0x96 U+2013 — | 0x9e U+017e Ÿ | |||
0x87 U+2021 ˆ | 0x8f ? | 0x97 U+2014 ˜ | 0x9f U+0178 |
type | range | notes | |
---|---|---|---|
u8 | unsigned integer | 0 … 255 (0xff) | |
u16 | 0 … 65535 (0xffff) | ||
u32 | 0 … 4294967295 (0xffffffff) | Limited support in DLO (pawn) due to s32 cell size. | |
u64 | Not supported, s64 may be good enough | ||
s8 | signed integer | -128 … 127 | |
s16 | -32768 … 32767 | ||
s32 | -2147483648 … 2147483647 | ||
s64 | -9.223e+15 … 9.223e+15 | Limited support in DLO (pawn) due to byte array representation. | |
f16 | floating point | ±9.76e-4 … ±1.048e+6 | half precision 3 significant digits |
f32 | ±1.18e−38 … ±3.4e+38 | single precision approx. 7 signifanct digits | |
f64 | ±2.23e−308 … ±1.80e+308 | double precision approx. 16 significant digits |
type | DLO char encoding | — | S&T* | — | POV, BLO |
---|---|---|---|---|---|
astr | ANSI CP-1252 or some other standard codepage | — | ANSI | — | utf-8 |
nstr | ANSI CP-1252 | — | utf-8**) | — | utf-8 |
cstr | ANSI any custom codepage | — | binary | — | binary-hex |
wstr | Unicode utf-32 | — | utf-8**) | — | utf-8 |
ustr | Unicode utf-8 | — | utf-8**) | — | utf-8 |
type | range | notes | |
---|---|---|---|
stamp32 | date & time | 1sec resolution | |
stamp40 | 1/256sec resolution | ||
bin | binary blob | anonymous collection of bytes (each 0 … 0xff) |
unsigned integer 8bit
unsigned integer 16bit
unsigned integer 32bit
signed integer 8bit
signed integer 16bit
signed integer 32bit
signed integer 64bit
half precision float 16bit
Pawn's native float type
explicit typecast to Float:
single precision float 32bit
precision 64bit float
seconds since 1999-12-31 00:00:00 UTC
1/256 seconds since 1999-12-31 00:00:00 UTC (extended accuracy)
Binary blob, byte array
{}
(curly braces) for declarations""
(double quotes) for literalsGeneric string type
new s{}="abc"
new s{}=''abc''
const s='abc'
ANSI typ. CP-1252 stored as 8bit ANSI
ANSI CP-1252 stored as utf-8
ANSI /w custom codepage stored as binary
Unicode utf-32 stored as utf-8
Unicode utf-8 stored as utf-8
Help is written as plain list of keyword definitions.
Each definition consist of
All definitions are collected in a bookbox, which is built from
A bookbox always follows this structure
The full declaration, including sub-definitions:
short description of relationships/procedure/principles
The <description> may contain any HTML tag (see example below),espcially these tags and predefined classes:
.important
.note
h5
Followed by some explanations...
#[code <any code>]
- inline code.code.dde
- code box for DDE.code.pawn
.code.help
.code.js
.code.blo.js
.code.pov.js
.cheatsheet
Save space
Put a link
use piped-text to concatenate some more lines to the div
(Don't forget the spaces then)
or use a block to easily write multiple lines even with embedded html tags.
just declare the constant name
The following description may consist of any element as described in howto#demohelp
declare name and it's numeric value
declare name and it's string value
Verbose descriptions
using
signed integer 32bit
ASCII string, C-style with terminating zero
derived type to give a better explanation ofit's purpose, range,...
derived array type
enum definition
it's recommended to specify a base type such as s32
3 axis coordinates
array of Txyz with 0+ items
array of Txyz with 1+ items
struct type /w inline const definition
function w/o params but result
.func.fvoid
... no results (void function).func.freturns
... returns some resultfunction /w params
/w callback parameter
/w "out only" params
The function operates on out parameters like that:
/w "in & out" (by ref) parameters
The function operates on inout parameters like that:
Standard library for the rapidM2M Studio ecosphere
Default return codes for general purposes.
Converts any Terror code into a string
Shows-up a totally unexpected program behaviour which can be usually caused due to erroneous programming only.
Declares a callback function for library methods such as setInterval.
Output a line to the console
Shows a value in TESTbed's watch panel. Adds the watch to TESTbed, showing its recent value and stamp.
If the Terror passed as parameter "err" indicates an error (i.e. err < 0), a corresponding error message is output via the console. However, using the parameter "xe" a single terror code can be excluded from being reported. Using the parameters "xe" and "xs", a customer-specific error message can be generated for a single terror code.
(those prefixed with § assertion symbol)
Provides the firmware with a buffer from the RAM area reserved for the device logic that is used to output strings via the printf() function. When this function is called up, the system switches from the 256 byte buffer integrated in the firmware to the transferred buffer.
Generates a new 1s timer.
Removes a 1s timer.
Generates a new ms timer.
Removes a ms timer.
Blocking delay function. The execution of the device logic is stopped and the following code line is only executed once the delay time has expired.
Reads the current time (in UTC) and date from the system.
Detailed breakdown of the date and time
Control flags for the rM2M_SetDateTime() function.
Sets the system date and time to the values contained in the transferred structure.
Returns the difference (in seconds) between the system time (UTC) and local time configured for the site on the rapidM2M Portal server. This can be used to determine the local time in the device logic by adding the difference to the system time (UTC). The offset value is determined by the rapidM2M Portal server in accordance with the set time zone (including summer/winter time) and is synchronised during every connection to the device.
Calculates the weekday from a given timestamp.
Triggers a connection to the server with subsequent synchronisation of all memory areas (measurement data, configuration, position data, device log, files,...) between the device and the server. Only those memory areas are transmitted whose content has been changed. If the device is in "online" mode and an active connection to the server is established then this function only triggers synchronisation. The established connection is not disconnected beforehand and then re-established.
Connection flags
Communication modes
Sets the connection type to be used. If the connection type is changed to "Online" or "Interval & wakeup", this is immediately followed by a connection being established incl. a synchronisation with the server, as long as this is not suppressed by the "RM2M_TXMODE_SUPPRESS_SYNC" flags being set. The same also applies to changing the connection type from "Interval" to "Interval & wakeup".
Connection type | Energy consumption | Data volumes | Response time |
---|---|---|---|
Online | **** | **** | * |
Interval & wakeup | ** | * | ** |
Interval | * | * | *** |
Connection error codes
Connection status
Returns the current connection status.
Available uplink interfaces
Selects the communication interface to be used for the uplink.
Statistical information on the uplink communication interface.
Returns the statistical information about the uplink communication interface.
Sets the interval at which the keep alive pings are sent during online mode.
Returns the signal strength at the communication interface used for the uplink.
Falls back to GSM/UMTS/LTE signal strength rM2M_GSMGetRSSI() if current firmware version does not support rM2M_GetRSSI() function.
Returns the signal strength at the communication interface used for the uplink.
Returns information on the GSM modem, SIM chip and the GSM network used during the last connection.
Mobile radio AcT (access technology)
SIM state
Information regarding the GSM modem, SIM chip and the GSM network used during the last connection.
Returns LTE connection evaluation info.
LTE connection evaluation information.
Information if Tracking Area Update would be triggered on evaluated connection.
Energy estimation of evaluated connection.
RRC state of evaluated connection.
rapidM2M provides up to 10 CONFIG containers for information exchange between DEVICE and BACKEND.
Typical content:
Each container may be marked either for
information flow.
Optionally containers may be marked volatile (configx_volatile).
By default, each config update at the device (DLO - DDE_xxx_write(), rM2M_CfgWrite()) is immediately persisted to FLASH memory.
Volatile containers avoid this adverse situation and allow a
A volatile container holds it's data changes in RAM instead of FLASH memory.
To enable volatility define the container like that:
To support recovery upon boot nevertheless and keep DDE_xxx_read() / onUplinkRestore_xxx() functions:
Sets the configuration for a configuration memory block. Calling the function is only necessary if one of the configuration flags should be set.
Additional explanation on the type of storage:
If Bit 0 was not set (default), the non-volatile storage of the configuration memory block in the FLASH is initiated when the rM2M_CfgWrite() function is called up.
If Bit0 was set (Bit0 = RM2M_CFG_VOLATILE), the configuration memory block is saved in the RAM in a volatile manner when the rM2M_CfgWrite() function is called. This option is recommended if the data in the configuration memory block changes frequently as this will reduce the number of flash write cycles. The rM2M_CfgFlush() function must be called up so that the configuration memory block is saved in a non-volatile manner in the FLASH.
Saves the transferred data block at the specified position in a configuration memory block. Note that the configuration memory block is either saved in the RAM in a volatile manner (Bit0 = RM2M_CFG_VOLATILE) or in the FLASH in a non-volatile manner (Bit0 = 0, default) depending on the type of storage selected via the rM2M_CfgInit() function. The function is also passed which of the 10 available memory blocks in the internal flash memory should be used. Use the rM2M_Pack(), rM2M_SetPacked() or rM2M_SetPackedB() functions to generate the data block that should be saved. The time stamp is updated, so that the configuration memory block is automatically synchronised with the rapidM2M Portal server during the next connection.
Saves the configuration memory block for which the number was transferred in the FLASH in a non-volatile manner. Calling the function is only necessary if "volatile in RAM (Bit0 = RM2M_CFG_VOLATILE)" was selected as the type of storage for the relevant configuration memory block via the rM2M_CfgInit() function.
Reads a data block from the specified position in a configuration memory block. The function is also informed which of the 10 available memory blocks in the internal flash memory should be read. Use the rM2M_Pack(), rM2M_GetPacked() or rM2M_GetPackedB() functions to unpack the read data.
Deletes all of the data of the transferred configuration memory block.
Specifies the function that should be called if one of the configuration memory blocks has changed (i.e. has been updated by the server).
The callback does not trigger upon local (device-side) changes of a config.
0..9 - Number of the configuration memory block starting with 0 for the first memory block. The device comprises 10 independent memory blocks.
rapidM2M provides up to 10 HISTDATA containers for exchange of timeseries data between DEVICE and BACKEND.
Typical content:
HISTDATA containers support UPward (sourced by device) direction, only.
All HISTDATA containers are interlaced into a single timeseries buffer for transmission. Therefore each record must
Transmits a data record as live data to the server. Calling this function is only permissible if the device is in "online" mode and an active connection to the server is established. Use the rM2M_Pack(), rM2M_SetPacked() or rM2M_SetPackedB() functions to generate the data area.
Saves a data record in the internal flash memory. Use the rM2M_Pack(), rM2M_SetPacked() or rM2M_SetPackedB() functions to generate the data area.
Reads out a data record saved in the internal flash and then calls up the function for which the index was transferred.
Writes the transferred data block to the specified position in an array.
Reads a data block that is located at the specified position in an array.
Configuration flags for the rM2M_Pack() function
Function to access packed data. If the Bit0 (RM2M_PACK_GET) of the "type" parameter was set, the function returns the value that is located at the specified position in the array. Otherwise the function writes the transferred value to the specified position in the array.
Swaps the order of the bytes
Initialises one of the optional registration memory blocks stored in the RAM. Calling up the function is only necessary for the registration memory blocks listed in the explanation of the "reg" parameter.
Reads a character string from a registration memory block.
Reads a value from a registration memory block.
Writes a character string into a registration memory block.
Writes a value into a registration memory block.
Searches for an entry based on its name and sets the value of this entry (regardless of whether it is a string or value) to "null".
Searches for an entry based on its name and deletes the entry from the registration memory block.
Specifies the function that should be called up if one of the registration memory blocks has changed (i.e. has been updated by the server). The callback is not triggered upon local (device-side) changes of a registration memory.
Indices of the registration memory blocks
Error codes for the registration memory block access operations
Saves the GPS position information in the device. A historical record is not maintained. This means that the current position information always overwrites the last known position. The information is transmitted to the rapidM2M Portal server and can, for example, be read out via the API.
Decodes a transferred NMEA data record.
For a type "RM2M_NMEA_RECORD_GGA" data record, the remaining structure is the same as the "TNMEA_GGA" structure.
Takes the GPS position information from the transferred NMEA data record and saves it in the device. A historical record is not maintained. This means that the current position information always overwrites the last known position. The information is transmitted to the rapidM2M Portal server and can, for example, be read out via the API.
Reads out the GPS position information saved to the device.
Makes it possible to transfer information about the GSM/UMTS/LTE cells and WiFi networks to the device. The position data is thus generated based on this information provided by the user. This function uses a variable list of parameters. The parameters to be passed depend on the purpose. The following procedure is recommended:
The internally saved list of cell/network information is discarded and a new one is prepared. The time stamp of this new list is set to the current time.
The transferred cell/network information entry is entered in the list that was created during step 1. The ".type" and ".stamp" entries in the "TrM2M_PosUpdatexxx" structure are ignored. A maximum of 20 cell/network information entries can be entered in the list.
The list of cell/network information entries is sorted (in descending order based on the reception level) and the time stamp is updated. The time stamp is used for the synchronisation of the position data with the server. If the device is currently in online mode, the position data is immediately transferred to the server. If the cell/network information entries are read out again via the rM2M_EnumPosUpdate() function, the time stamp generated during step 3 is entered in the "TrM2M_PosUpdatexxx" structure.
lists the information saved in the device about the GSM/UMTS/LTE cells and WiFi networks in the receiving range. This function uses a variable list of parameters. The parameters to be passed depend on the purpose. The following procedure is recommended:
Either the "type" parameter or the two "buf" and "len" parameters are required in addition depending on the desired action.
The structure of the buffer depends on the cell/network information entry to be read.
Returns the number of GSM/UMTS/LTE cells for which valid information is saved in the device (posidx < 0) or reads out the information saved in the device about a GSM/UMTS/LTE cell in the receiving range (posidx >= 0).
Information about a GSM/UMTS/LTE cell in the receiving range
Geographical latitude in degrees (resolution: 0.000001°)
Geographical longitude in degrees (resolution: 0.000001°)
Height above sea level in meters
NMEA Quality indicator
Error codes of the function rM2M_SetPosNMEA()
Information (position, height above sea level and accuracy) extracted from a GGA data record.
List of the supported types of cell/network information entries
Information about a GSM cell in the receiving range
Information about a UMTS cell in the receiving range
Information about an LTE cell in the receiving range
Information about a WiFi network in the receiving range
Supplies the smaller of the two transferred values
Supplies the larger of the two transferred values
Checks whether the transferred value is between "min" and "max" (cut-off value at the min/max limits)
Checks whether the transferred value is between "min" and "max" (wrap around value at the min/max limits)
e
log_2 e
log_10 e
log_e 2
log_e 10
pi
pi/2
pi/4
1/pi
2/pi
2/sqrt(pi)
sqrt(2)
1/sqrt(2)
Commercially rounds the transferred float
Sine of x
Cosine of x
Tangent of x
Arcsine(x) in the range [-π/2, π/2], x element of [-1, 1]
Arccosine(x) in the range [0, π], x element of [-1, 1]
Arctangent(x) in the range [-π/2, π/2]
Arctangent(y/x) in the range [-π, π]
Hyperbolic sine of x
Hyperbolic cosine of x
Hyperbolic tangent of x
Exponential function ex
Natural logarithm ln(x), x > 0
Logarithm as the basis 10
Square root x, x >= 0
Smallest whole number that is not smaller than x
Largest whole number that is not larger than x
Returns absolute value | n |
Absolute value | x |
Breaks down x into a normalised mantissa in the range [1/2, 1] that is supplied as the result, and a potency of 2 that is filed in n. If x is zero, both parts of the result are zero.
Breaks down x into an integral and residual part that both have the same prefix as x. The integral part is filed in ip, while the residual part is the result.
Residual floating point of x/y with the same prefix as x. The result is dependent on the implementation, if y is zero.
Returns a value that is not equal to zero, if x is not a number
Returns a random number from the "32-Bit signed Integer" value range. However, value "-1" (ERROR) is reserved for returning an error.
Transmits the content of a standard variable of the script language (32 bit signed integer) into an array which is designed for storing a 64 bit signed integer value.
Transmits a 64 bit signed integer value into a standard variable of the script language
Sums up two 64 bit signed integer values (sum = term1 + term2)
Subtracts a 64 bit signed integer value from another one (difference = minuend - subtrahend)
Multiplies two 64 bit signed integer values (product = multiplier * multiplicand )
Divides a 64 bit signed integer value by another one (quotient = dividend / divisor)
Determines the reminder of the division of 64 bit signed integer values (reminder = dividend % divisor )
Shifts the 64 bit signed integer value contained in the array 'val' 'bits' number of bits to the left (val <<= bits). The freed up bits are filled up with 0. This is an arithmetic shift, i.e. the leading sign is retained.
Shifts the 64 bit signed integer value contained in the array 'val' 'bits' number of bits to the right (val >>= bits). The freed up bits are filled up with 0. This is an arithmetic shift, i.e. the leading sign is retained.
Compares the 64 bit signed integer values val1 and val2
Returns the number of characters in a zero terminated ascii/packed string (without '\0')
Returns the number of characters in a zero terminated wide/unpacked string (without '\0')
Returns the number of characters in a zero terminated string (without '\0')
Saves the transferred format string in the array dest. The mode of operation of the functions corresponds to that of the "snprintf" function of the standard ANSI-C implementation.
Copies the source character string to the array dest (including '\0').
Adds the source character string to the dest character string (including '\0')
Compares character string1 and string2
Searches for a character (first occurrence) in a character string
Searches for a character (last occurrence) in a character string
Searches for the position of the first character in string1 that is
Searches for the position of the first character in string1 that is
See similar function strpbrk() which has a slightly different result.
Searches the array index of the first character that is also included in the character string of permitted characters.
See similar function strcspn() which has a slightly different result.
Searches character string2 in character string1
Converts a character string into an integer representation using base 10
Similar to strtol( str, 10)
Converts a character string into a value.
Converts a character string into a float
Copies bytes from one buffer to another one
Writes the desired value into the individual bytes of the transferred buffer
Compares two buffers, byte for byte
Converts a character into lower case
Converts a character into upper case
Returns the calculated modbus CRC16 of the transferred data.
Returns the calculated Ethernet CRC32 of the transferred data.
Context structure for the MD5 calculation
Calculates the MD5 hash for the transferred data. If the hash for a data block should be calculated by calling up this function several times (e.g. when receiving data in blocks), then the same context structure must be transferred every time the function is called up. The context structure must not be changed between function call-ups. If the hash can be calculated by calling up the function once (e.g. complete data block is already available), then it is not necessary to transfer its own context structure.
Checks whether the required rapidM2M device API function is supported by the device firmware.
Issues the implemented API level of the script engine.
Checks whether the required rapidM2M API function is supported by the device firmware.
Loads a script module at the runtime. This enables the script engine to be extended by its own native functions. The implementation of operations as a native function means that processing speeds can be increased significantly in comparison to the implementation in pawn. A script module can contain several native functions. After calling up this function, the native functions contained in the script module can be used in the same way as the standard functions available in the script engine.
Information regarding the runtime measurement
Starts a runtime measurement.
Stops the runtime measurement and calculates the time in [ms] since the rtm_start() function was called up and the instructions executed since then. The determined values are written in the ".runtime" and ".instructions" elements of the transferred structure to record the information regarding a runtime measurement.
Returns the ticks since the device booted
ticks | resolution | range |
1 | 1 second | 68 years |
10 | 100ms | 6.8 years |
100 | 10ms | 249 days |
256 | 1/256s | 97 days |
Two-column reference point table, integer data type
Two-column reference point table, float data type
Error codes for the "CalcTable" and "CalcTableF" functions
Searches for a certain value in the "key" column of the transferred reference point table and supplies the relevant value from the "value" column in the table. If the searched value is between two reference points, the returned value is interpolated linearly between the two adjacent values in the "value" column (linear equation: y = k*x + d). Non-linear characteristic curves (e.g. connection between ADC value -> temperature) can be reproduced with this function.
Searches for a certain value in the "key" column of the transferred reference point table and supplies the relevant value from the "value" column in the table. If the searched value is between two reference points, the returned value is interpolated linearly between the two adjacent values in the "value" column (linear equation: y = k*x + d). Non-linear characteristic curves (e.g. connection between ADC value -> temperature) can be reproduced with this function.
Supplies the amount of free memory available for heap and stack.
Provides the information to identify the module/device.
Information for identifying the module/device
This function supplies an argument from a variable argument list. If the argument is an array, the "index" specifies the index of the required array element.
This function sets an argument in a variable argument list. If the argument is an array, the "index" specifies the index of the required array element.
Initialises SMS receipt.
Deactivates SMS receipt.
Properties of a file entry
File flags
File transfer command
Converts a file transfer command into a string
Offset | Bytes | Explanation |
---|---|---|
0 | 4 | Time stamp of the file |
8 | 4 | File size in byte |
12 | 4 | Ethernet CRC32 of the file |
16 | 2 | File flags |
18 | 256 | File name |
Registers a file made available by the device logic.
Registers a file node made available by the device logic. Several files can be managed via a file node.
Removes a file from the registration. The file is no longer available for the file transfer.
Sets the properties of a file (extended format).
Transmits the data to the system, to transfer it to the rapidM2M Portal server. The data must be provided by the callback function specified via FT_Register().
Accepts the file that the rapidM2M Portal server wants to write. It is a new file if the transferred unique identification number ("id" parameter) refers to a file node. In this case, an unique identification number ("newid" parameter) must be assigned to the new file. The new file must also be registered via the FT_Register() function. The file properties that were transmitted by the system to the callback function (see TFT_Callback) must be saved via the FT_SetProps() function.
Confirms that the data received from the rapidM2M Portal server has been written. The actual writing process must be executed via the callback function specified via FT_Register(). The data that is to be written is transmitted to the callback function by the system (see TFT_Callback).
Used to display a file handling error and terminates any file command.
Total size of temporary console output buffer used to hold results of #log(), #watch(), assert() formatting
Global settings for ~stdlib
Returns the GSM/UMTS/LTE signal strength.
Writes the transferred value to a specified position in an array.
Additional explanation on the byte sequence:
In the following example, the whole number 439.041.101 is saved as a 32-bit integer value from memory address 10000.
Big endian | Little endian | |||||
---|---|---|---|---|---|---|
Addresses | Hex | Dez | Binary | Hex | Dez | Binary |
10000 | 1A | 26 | 00011010 | 4D | 77 | 01001101 |
10001 | 2B | 43 | 00101011 | 3C | 60 | 00111100 |
10002 | 3C | 60 | 00111100 | 2B | 43 | 00101011 |
10003 | 4D | 77 | 01001101 | 1A | 26 | 00011010 |
Supplies the value that is located at the specified position in an array.
Additional explanation on the byte sequence:
In the following example, the whole number 439.041.101 is saved as a 32-bit integer value from memory address 10000.
Big endian | Little endian | |||||
---|---|---|---|---|---|---|
Addresses | Hex | Dez | Binary | Hex | Dez | Binary |
10000 | 1A | 26 | 00011010 | 4D | 77 | 01001101 |
10001 | 2B | 43 | 00101011 | 3C | 60 | 00111100 |
10002 | 3C | 60 | 00111100 | 2B | 43 | 00101011 |
10003 | 4D | 77 | 01001101 | 1A | 26 | 00011010 |
Sets the properties of a file.
Supplies the index of a public function. Used to register callbacks for the Pawn runtime environment.
Prints the specified string to the standard output.
Prints the transferred format string to the standard output. The mode of operation of the functions corresponds to that of the standard ANSI-C implementation.
Standard library for the rapidM2M Studio ecosphere
Define the interface data structures for the rapidM2M application model. Typical content:
define a constant
→ #configZ
→ #configZ
→ #configZ
define a backend-only, single instance container
→ #configX
→ #configX
→ #configX
→ #configX
→ #configX
→ #configX
→ #configX
→ #configX
→ #configX
→ #configX
define a versatile single instance container
See configx_volatile for details.
or
→ #histdataX
→ #histdataX
→ #histdataX
→ #histdataX
→ #histdataX
→ #histdataX
→ #histdataX
→ #histdataX
→ #histdataX
→ #histdataX
versatile time-series container
enable alarms and warnings time series
a special container to transport live data during put-into-operation procedures
Override automatic storage allocation and position all following fields starting at given target.
Standard library for the rapidM2M Studio ecosphere
Standard library for the rapidM2M Studio ecosphere
Initialises and configures BrownOut monitoring for the voltage supply input VIN.
Shuts the system down.
Device Logic execution is stopped during this process and all of the interfaces (e.g. USB; modem) are closed. The power supply can then be deactivated safely.
Reads the last valid operating voltage values VIN and VAUX from the system. The interval for determining these values is 1sec. and cannot be changed.
Measurement values for the operating voltages
Sets the signal direction for a GPIO.
-1 | Resistor deactivated |
RM2M_GPIO_INPUT_PULLDOWN | Pull-down resistor activated |
RM2M_GPIO_INPUT_PULLUP | Pull-up resistor activated |
Value | Type of output | Initial output level | Internal resistor |
---|---|---|---|
-1 | Push-pull | last set output level | deactivated |
RM2M_GPIO_OUTPUT_LOW | Push-pull | "low" | deactivated |
RM2M_GPIO_OUTPUT_HIGH | Push-pull | "high" | deactivated |
RM2M_GPIO_OUTPUT_OD | Open-drain | "high" | deactivated |
RM2M_GPIO_OUTPUT_OD_PULLUP | Open-drain | "high" | pull-up |
RM2M_GPIO_OUTPUT_OS | Open-source | "low" | deactivated |
RM2M_GPIO_OUTPUT_OS_PULLDOWN | Open-source | "low" | pull-down |
Set the output level of a GPIO that was configured as an output.
Read the signal level of a GPIO that was configured as an input.
Number of GPIO pin, ranging from 0 (= first GPIO of the device) to DP_GPIO_CNT-1
Signal direction settings of the GPIOs
Signal levels of the GPIOs
Options for Gpio direction INPUT used with rM2M_GpioDir()
Options for Gpio direction OUTPUT used with rM2M_GpioDir()
Activates the interrupt functionality of an interruptible pin.
Edge and resistor configuration for the rM2M_IrqInit() function
Deactivates the interrupt functionality of an interruptible pin.
Number of IRQ pin, ranging from 0 (= first interruptible pin of the device) to DP_IRQ_CNT-1
Provides the firmware for the selected UART interface with a sending and/or receiving buffer from the RAM area reserved for the device logic. When this function is called up, the system switches from the two buffers integrated in the firmware to the passed buffers.
Initialises the UART interface.
Closes the UART interface.
Sends data via the specified UART interface.
Sends a string via the specified UART interface.
Number of the UART port ranging from 0 (= first UART interface of the device) to DP_UART_CNT-1
Initialises the I²C interface.
Closes the I²C interface.
Executes an I²C communication. Data is first of all sent and data is then received.
Number of the I²C port ranging from 0 (=first I²C interface of the device) to DP_I2C_CNT-1
Error codes of the rM2M_I2cCom() function
Initialises the SPI interface.
Clock polarity: Idle "high"
Clock phase: Data are adopted at the first edge
SPI clock polarity and phase configuration
Closes the SPI interface.
Executes an asynchronous SPI communication. Data is first of all sent and data is then received.
Number of the SPI port ranging from 0 (= first SPI interface of the device) to DP_SPI_CNT-1
Initialises the open drain output to which an LED can be connected
Deactivates the open drain output to which an LED can be connected. The output cannot be controlled by the firmware or the device logic functions.
Sets the open drain output to "low", which triggers a LED connected between the supply and output to light up.
Sets the open drain output to "high", which triggers an LED connected between the supply and output to switch off.
Enables an LED connected to the open drain output to flash (ton = 500ms , toff = 500ms ).
Enables an LED connected to the open drain output to briefly flash every 500ms .
Enables an LED connected to the open drain output to flicker (ton = 94ms , toff = 31ms ).
WiFi states
WiFi events
Internal WiFi interface error
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_ERROR" event.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_DEVINFO" event. It contains information regarding the WiFi module installed in the device.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SCAN" event. It contains information regarding a WiFi network in the receiving range.
Process for assigning the IP address configuration
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_CONNECTED" event. It contains information regarding the network to which a connection was established.
Reasons for WiFi disconnection
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_DISCONNECTED" event.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_RSSI" event.
Encryption methods
Initialises the WiFi interface
Closes the WiFi interface
Returns the current status of the WiFi interface
Starts the search for available WiFi networks on all channels supported by the installed WiFi module.
Establishes a connection to an access point.
Disconnects the current connection to the access point.
Starts determining the WiFi RSSI level [dBm].
Configuration for an access point
Configures and activates the device in access point mode
Address families for socket connections
Type of socket
Socket address information for IPv4 addresses. Either contains
Error codes for socket operations
Generates a socket. If a socket could be generated, it can be used immediately (synchronous operation).
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SOCKET_BIND" event.
Assigns the address information (address family, port and IP address) to a socket (asynchronous operation). Once the operation is completed, the "WIFI_EVENT_SOCKET_BIND" event is triggered, which must be evaluated by the callback function (see TWiFi_Callback) that is to be provided by the device logic developer.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SOCKET_LISTEN" event.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SOCKET_ACCEPT" event. It contains information regarding a socket connection accepted by the system (WiFi module and firmware).
Prepares the socket to react to incoming connections (only necessary for connection-oriented stream connection, e.g. TCP server) (asynchronous operation). Once the operation is completed, the "WIFI_EVENT_SOCKET_LISTEN" event is triggered, which must be evaluated by the callback function (see TWiFi_Callback) that is to be provided by the device logic developer. If the LISTEN operation could be completed successfully, then the socket is ready for incoming connections. In the event of an incoming connection, the "WIFI_EVENT_SOCKET_ACCEPT" event is triggered, which must be evaluated by the callback function that is to be provided by the device logic developer.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SOCKET_CONNECT" event.
Establishes a TCP connection to a server (asynchronous operation). Once the operation is completed, the "WIFI_EVENT_SOCKET_CONNECT" event is triggered, which must be evaluated by the callback function (see TWiFi_Callback) that is to be provided by the device logic developer.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SOCKET_RECV" event. It either contains the number of received bytes or specifies the error that has occurred.
Function to receive data via a TCP socket (asynchronous operation). Once data is received, the "WIFI_EVENT_SOCKET_RECV" event is triggered and the received data must be processed by the callback function (see TWiFi_Callback) that is to be provided by the device logic developer.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SOCKET_RECVFROM" event. It contains information regarding data received when using a connectionless network protocol (e.g. UDP).
Function to receive data via a UDP socket (asynchronous operation). Once data is received, the "WIFI_EVENT_SOCKET_RECVFROM" event is triggered and the received data must be processed by the callback function (see TWiFi_Callback) that is to be provided by the device logic developer.
Provides the firmware with a buffer from the RAM area reserved for the device logic for the specified socket. The transferred memory is used to internally process data in connection with the specified socket. The buffer should be assigned using this function immediately after generating the socket. As long as the socket has not been closed using the WiFi_sockClose() function, the transferred buffer may not be accessed via the device logic.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SOCKET_SEND" (TCP) and "WIFI_EVENT_SOCKET_SENDTO (UDP)" events.
Function to send data via a TCP socket (asynchronous operation). Once the data has been sent, the "WIFI_EVENT_SOCKET_SEND" event is triggered, which must be evaluated by the callback function (see TWiFi_Callback) that is to be provided by the device logic developer.
Function to send data via a UDP socket (asynchronous operation). Once the data has been sent, the "WIFI_EVENT_SOCKET_SENDTO" event is triggered, which must be evaluated by the callback function (see TWiFi_Callback) that is to be provided by the device logic developer.
Closes the socket and releases all of the resources assigned to the socket (synchronous operation)
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_DNS_RESOLVE" event.
Asynchronous function to resolve a host name (e.g. URL) into a host IP address using the domain name system (DNS). The IP address of a DNS server must be saved to be able to execute the operation correctly. This address must either be obtained from the access point when using DHCP or must be written in the "REG_APP_FLASH" registration memory block. The rM2M_RegSetString() function can be used for this purpose. If the resolution of the host name is completed (OK or NOT OK), the "WIFI_EVENT_DNS_RESOLVE" event is triggered by the system and the determined IP address can continue to be processed with the help of the callback function that is to be provided by the device logic developer (see TWiFi_Callback).
Standard library for the rapidM2M Studio ecosphere
Shuts the system down.
Device Logic execution is stopped during this process and all of the interfaces (e.g. USB; modem) are closed. The power supply can then be deactivated safely.
Reads the last valid operating voltage values VIN and VAUX from the system. The interval for determining these values is 1sec. and cannot be changed.
Measurement values for the operating voltages
Sets the signal direction for a GPIO.
-1 | Resistor deactivated |
RM2M_GPIO_INPUT_PULLDOWN | Pull-down resistor activated |
RM2M_GPIO_INPUT_PULLUP | Pull-up resistor activated |
Value | Type of output | Initial output level | Internal resistor |
---|---|---|---|
-1 | Push-pull | last set output level | deactivated |
RM2M_GPIO_OUTPUT_LOW | Push-pull | "low" | deactivated |
RM2M_GPIO_OUTPUT_HIGH | Push-pull | "high" | deactivated |
RM2M_GPIO_OUTPUT_OD | Open-drain | "high" | deactivated |
RM2M_GPIO_OUTPUT_OD_PULLUP | Open-drain | "high" | pull-up |
RM2M_GPIO_OUTPUT_OS | Open-source | "low" | deactivated |
RM2M_GPIO_OUTPUT_OS_PULLDOWN | Open-source | "low" | pull-down |
Set the output level of a GPIO that was configured as an output.
Read the signal level of a GPIO that was configured as an input.
Number of GPIO pin, ranging from 0 (= first GPIO of the device) to DP_GPIO_CNT-1
Signal direction settings of the GPIOs
Signal levels of the GPIOs
Options for Gpio direction INPUT used with rM2M_GpioDir()
Options for Gpio direction OUTPUT used with rM2M_GpioDir()
Activates the interrupt functionality of an interruptible pin.
Edge and resistor configuration for the rM2M_IrqInit() function
Deactivates the interrupt functionality of an interruptible pin.
Number of IRQ pin, ranging from 0 (= first interruptible pin of the device) to DP_IRQ_CNT-1
Provides the firmware for the selected UART interface with a sending and/or receiving buffer from the RAM area reserved for the device logic. When this function is called up, the system switches from the two buffers integrated in the firmware to the passed buffers.
Initialises the UART interface.
Closes the UART interface.
Sends data via the specified UART interface.
Sends a string via the specified UART interface.
Number of the UART port ranging from 0 (= first UART interface of the device) to DP_UART_CNT-1
Initialises the I²C interface.
Closes the I²C interface.
Executes an I²C communication. Data is first of all sent and data is then received.
Number of the I²C port ranging from 0 (=first I²C interface of the device) to DP_I2C_CNT-1
Error codes of the rM2M_I2cCom() function
Initialises the SPI interface.
Clock polarity: Idle "high"
Clock phase: Data are adopted at the first edge
SPI clock polarity and phase configuration
Closes the SPI interface.
Executes an asynchronous SPI communication. Data is first of all sent and data is then received.
Number of the SPI port ranging from 0 (= first SPI interface of the device) to DP_SPI_CNT-1
Initialises the open drain output to which an LED can be connected
Deactivates the open drain output to which an LED can be connected. The output cannot be controlled by the firmware or the device logic functions.
Sets the open drain output to "low", which triggers a LED connected between the supply and output to light up.
Sets the open drain output to "high", which triggers an LED connected between the supply and output to switch off.
Enables an LED connected to the open drain output to flash (ton = 500ms , toff = 500ms ).
Enables an LED connected to the open drain output to briefly flash every 500ms .
Enables an LED connected to the open drain output to flicker (ton = 94ms , toff = 31ms ).
WiFi states
WiFi events
Internal WiFi interface error
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_ERROR" event.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_DEVINFO" event. It contains information regarding the WiFi module installed in the device.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SCAN" event. It contains information regarding a WiFi network in the receiving range.
Process for assigning the IP address configuration
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_CONNECTED" event. It contains information regarding the network to which a connection was established.
Reasons for WiFi disconnection
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_DISCONNECTED" event.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_RSSI" event.
Encryption methods
Initialises the WiFi interface
Closes the WiFi interface
Returns the current status of the WiFi interface
Starts the search for available WiFi networks on all channels supported by the installed WiFi module.
Establishes a connection to an access point.
Disconnects the current connection to the access point.
Starts determining the WiFi RSSI level [dBm].
Configuration for an access point
Configures and activates the device in access point mode
Address families for socket connections
Type of socket
Socket address information for IPv4 addresses. Either contains
Error codes for socket operations
Generates a socket. If a socket could be generated, it can be used immediately (synchronous operation).
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SOCKET_BIND" event.
Assigns the address information (address family, port and IP address) to a socket (asynchronous operation). Once the operation is completed, the "WIFI_EVENT_SOCKET_BIND" event is triggered, which must be evaluated by the callback function (see TWiFi_Callback) that is to be provided by the device logic developer.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SOCKET_LISTEN" event.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SOCKET_ACCEPT" event. It contains information regarding a socket connection accepted by the system (WiFi module and firmware).
Prepares the socket to react to incoming connections (only necessary for connection-oriented stream connection, e.g. TCP server) (asynchronous operation). Once the operation is completed, the "WIFI_EVENT_SOCKET_LISTEN" event is triggered, which must be evaluated by the callback function (see TWiFi_Callback) that is to be provided by the device logic developer. If the LISTEN operation could be completed successfully, then the socket is ready for incoming connections. In the event of an incoming connection, the "WIFI_EVENT_SOCKET_ACCEPT" event is triggered, which must be evaluated by the callback function that is to be provided by the device logic developer.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SOCKET_CONNECT" event.
Establishes a TCP connection to a server (asynchronous operation). Once the operation is completed, the "WIFI_EVENT_SOCKET_CONNECT" event is triggered, which must be evaluated by the callback function (see TWiFi_Callback) that is to be provided by the device logic developer.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SOCKET_RECV" event. It either contains the number of received bytes or specifies the error that has occurred.
Function to receive data via a TCP socket (asynchronous operation). Once data is received, the "WIFI_EVENT_SOCKET_RECV" event is triggered and the received data must be processed by the callback function (see TWiFi_Callback) that is to be provided by the device logic developer.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SOCKET_RECVFROM" event. It contains information regarding data received when using a connectionless network protocol (e.g. UDP).
Function to receive data via a UDP socket (asynchronous operation). Once data is received, the "WIFI_EVENT_SOCKET_RECVFROM" event is triggered and the received data must be processed by the callback function (see TWiFi_Callback) that is to be provided by the device logic developer.
Provides the firmware with a buffer from the RAM area reserved for the device logic for the specified socket. The transferred memory is used to internally process data in connection with the specified socket. The buffer should be assigned using this function immediately after generating the socket. As long as the socket has not been closed using the WiFi_sockClose() function, the transferred buffer may not be accessed via the device logic.
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_SOCKET_SEND" (TCP) and "WIFI_EVENT_SOCKET_SENDTO (UDP)" events.
Function to send data via a TCP socket (asynchronous operation). Once the data has been sent, the "WIFI_EVENT_SOCKET_SEND" event is triggered, which must be evaluated by the callback function (see TWiFi_Callback) that is to be provided by the device logic developer.
Function to send data via a UDP socket (asynchronous operation). Once the data has been sent, the "WIFI_EVENT_SOCKET_SENDTO" event is triggered, which must be evaluated by the callback function (see TWiFi_Callback) that is to be provided by the device logic developer.
Closes the socket and releases all of the resources assigned to the socket (synchronous operation)
Structure of the data to be evaluated via callback in case of the "WIFI_EVENT_DNS_RESOLVE" event.
Asynchronous function to resolve a host name (e.g. URL) into a host IP address using the domain name system (DNS). The IP address of a DNS server must be saved to be able to execute the operation correctly. This address must either be obtained from the access point when using DHCP or must be written in the "REG_APP_FLASH" registration memory block. The rM2M_RegSetString() function can be used for this purpose. If the resolution of the host name is completed (OK or NOT OK), the "WIFI_EVENT_DNS_RESOLVE" event is triggered by the system and the determined IP address can continue to be processed with the help of the callback function that is to be provided by the device logic developer (see TWiFi_Callback).
Handle for a specific file
Return codes for file operations
File access modes for the function fopen()
Reference position within the file for the function fseek()
File attributes (bitmask)
End of file indication
Provides the firmware with a memory to manage the files from the RAM area reserved for the device logic.
Opens a file and supplies the file handle that is required for the following file operations.
Closes an open file.
Deletes an existing file or subdirectory.
Renames an existing file or subdirectory.
Creates a new directory.
Lists all of the files and subdirectories in the specified directory.
Writes data in to a file.
Reads data out of a file.
Specifies the position within a file from which the data should be written/read.
Returns the size of a file.
Returns information regarding a file or subdirectory.
Specifies the size of the free memory in the file system.
Information regarding NVRAM
Returns information about the NVRAM.
Reads data out of the NVRAM.
Writes data in to the NVRAM.
USB Host events
Descriptor structure for USB devices
Initialises and configures the USB host interface.
Closes and deactivates the USB host interface.
Sends CDC data to a USB device.
Standard library for the rapidM2M Studio ecosphere
init and configure sensor detection interface
called on sensor detection state change
close and deactivate sensor detection interface
identification structure of BLE chip
retrieve identification of BLE chip
Maximum BLE connections
Sets manufacturer specific data which is part of the response when a BLE central performes an active scan.
activate or deactivate sensor supply
called on sensor supply on or off
initialises the BLE interface and specifies the function that should be called up if a BLE event has occurred
callback registered with BLE_Init
Information regarding a BLE peripheral found during a (passive or active) scan process (used with TBLE_event() callback)
Content/data of a characteristic for which the notification was activated
Block of requested data from a characteristic
Deactivates the BLE interface. In doing so, the connection to the sensors connected at this time is also automatically disconnected.
reset BLE interface
Returns the current status of the BLE interface
Starts the scan process according to the BLE peripherals
Establishes the connection to a BLE peripheral
Disconnects the connection to a BLE peripheral
Returns the connection status for a certain BLE peripheral
Writes data in a certain characteristic of a BLE peripheral
Reads data from a certain characteristic of a BLE peripheral
Changes the BLE connection interval (i.e. interval at which the data is exchanged)
Returns the information to identify the BLE module installed in the device
Sends RAW commands to the BLE module.
Provides the firmware with one buffer for sending and one for receiving characters via the BLE interface from the RAM area reserved for the device logic. When this function is called up, the system switches from the 256 bytes buffers integrated in the firmware to the transferred buffers.
Information to identify the BLE module installed in the device
Information on how a scan process (passive or active) was completed
Information on how the write process on a characteristic was completed
Information on how the read process on a characteristic was completed
Information to identify the BLE module installed in the device.
Information regarding the status change of the connection with a BLE peripheral
Information regarding which error has occurred
Possible BLE events for the callback function TBLE_event()
Status of the BLE interface.
Size of the notification data area
Size of the data area of a read data block
BLE error codes
Max. length of the designation for the BLE module
Max. length of the designation for the application installed on the BLE module
Max. length for the string that specifies the HW revision
Max. length for the string that specifies the FW revision
Designation of the BLE module installed in the device
Designation of the application installed on the BLE module
retrieve sys values of device
Initialises the solenoid switch
Deactivates the solenoid switch. An action is no longer initiated when the button is pressed.
init display
power on display (needs 300ms to execute)
power off display
add an element to the display
remove an element from the display
set content of an element
clear content of an element
Sets the charge mode.
Activates malfunction monitoring for the supply or charging voltage V IN and specifies the function that should be called up in the event of the supply or charging voltage V IN failing.
Deactivates malfunction monitoring for the supply or charging voltage V IN
Provides information on the energy source used and power management status
Reads the current state of the Coulomb counter (electric charge) that can be used for the application derived from the system's internal Coulomb counter
Information on the energy source used and power management status
Standard library for the rapidM2M Studio ecosphere
Initialises the lid reed contact
Deactivates the lid reed contact.
Reads the last valid values for the "Internal housing temperature" and "Air humidity in the housing" from the system. The interval for determining these values is 10sec. and cannot be changed.
Internal measurement values
Init and configure external temperature sensing module
Closes the PT100/1000 interface.
Reads the temperature measurement value for the specified PT100/1000 interface from the temperature module.
Number of temperature sensor interfaces, with which the device is equipped
Number of temperature sensor interfaces, ranging from 0 to DP_TEMP_CNT-1
Initialises the isolated switch contact (NO, CC).
Only a multiple of the sample rate for the universal inputs selected via the UI_SetSampleRate() function can be set for the pulse duration in "Pulse/min." mode. The actual pulse duration is calculated as follows:
Deactivates the isolated switch contact (NO, CC)
Specifies the setpoint for the isolated switch contact (NO, CC).
Note that the maximum number of pulses that can be issued per minute is dependent on the pulse duration specified via the DigOut_Init() function:
Pulse duration = (cfg1/sample rateUI + 1) x sample rateUI
The time required to issue the specified number of pulses is dependent on the pulse duration and pulse pause specified via the DigOut_Init() function:
Number of the digital output (isolated switch contact), ranging from 0 to DP_DIGOUT_CNT-1
Number of digital outputs, with which the device is equipped
Deactivates the switchable sensor supply VOUT.
Activates the switchable 3,3V supply voltage VEXT.
Deactivates the switchable 3,3V supply voltage VEXT.
Initialises the RS232 interface
Closes the RS232 interface
Sends data via the specified RS232 interface
Provides the firmware with one buffer for sending and one for receiving characters via the RS232 interface from the RAM area reserved for the Device Logic. When this function is called, the system switches from the 256 byte buffers integrated in the firmware to the transferred buffers.
Number of the RS232 port ranging from 0 to DP_RS232_CNT-1
Initialises the RS485 interface
Closes the RS485 interface
Sends data via the specified RS485 interface
Provides the firmware with one buffer for sending and one for receiving characters via the RS485 interface from the RAM area reserved for the Device Logic. When this function is called, the system switches from the 256 byte buffers integrated in the firmware to the transferred buffers.
Number of the RS485 port ranging from 0 to DP_RS485_CNT-1
Returns the information to identify the BLE module installed in the device
initialises the BLE interface and specifies the function that should be called up if a BLE event has occurred
Deactivates the BLE interface. In doing so, the connection to the sensors connected at this time is also automatically disconnected.
Returns the current status of the BLE interface
Starts the scan process according to the BLE peripherals
Establishes the connection to a BLE peripheral
Disconnects the connection to a BLE peripheral
Returns the connection status for a certain BLE peripheral
Writes data in a certain characteristic of a BLE peripheral
Reads data from a certain characteristic of a BLE peripheral
Changes the BLE connection interval (i.e. interval at which the data is exchanged)
Sets manufacturer specific data which is part of the response when a BLE central performes an active scan.
Sends RAW commands to the BLE module.
Provides the firmware with one buffer for sending and one for receiving characters via the BLE interface from the RAM area reserved for the device logic. When this function is called up, the system switches from the 256 bytes buffers integrated in the firmware to the transferred buffers.
Information to identify the BLE module installed in the device
Information regarding a BLE peripheral found during a (passive or active) scan process (used with TBLE_event() callback)
Information on how a scan process (passive or active) was completed
Content/data of a characteristic for which the notification was activated
Information on how the write process on a characteristic was completed
Block of requested data from a characteristic
Information on how the read process on a characteristic was completed
Information to identify the BLE module installed in the device.
Information regarding the status change of the connection with a BLE peripheral
Information regarding which error has occurred
Possible BLE events for the callback function TBLE_event()
Maximum BLE connections
Status of the BLE interface.
Size of the notification data area
Size of the data area of a read data block
BLE error codes
Max. length of the designation for the BLE module
Max. length of the designation for the application installed on the BLE module
Max. length for the string that specifies the HW revision
Max. length for the string that specifies the FW revision
Designation of the BLE module installed in the device
Designation of the application installed on the BLE module
Initialises the solenoid switch
Deactivates the solenoid switch. An action is no longer initiated when the button is pressed.
Initialises the two-colour LED
Deactivates the two-colour LED.
The two-colour LED consists of a red and a green LED that can be switched on separately by this function. If both LEDs are switched on simultaneously, the two-colour LED lights up orange.
The two-colour LED consists of a red and a green LED that can be switched off separately by this function.
Enables the two-colour LED to flash (ton = 500ms , toff = 500ms ).
Enables the two-colour LED to briefly flash every 500ms.
Enables the two-colour LED to flicker (ton = 94ms , toff = 31ms ).
Control universal input modes and sample rate, reset counter value and get current value.
Initialises an universal input (UI 1 - UI 4). The sample rate for acquiring the measurement value is configured by the UI_SetSampleRate() function. Calling up the UI_SetSampleRate() function is only necessary, if the default sample rate setting of 16Hz (62,5ms) is not suitable for your application.
Time in [ms] during which the signal must remain constant to initiate a level change. Used to suppress brief faults (debouncing).
Time in [ms] during which the analogue signal is averaged for signal smoothing. Used to suppress signal noise.
Deactivates an universal input (UI 1 - UI 4).
Reads the last valid measurement value for the specified universal input from the system.
Sets the sample rate for the measurement value acquisition at the universal inputs. The specified setting is always valid for all of the universal inputs. Special settings for individual universal inputs are not possible. The default value of the sample rate is 16Hz (62,5ms).
Resets the counter reading of an universal input that is being operated in "Counter" mode. If no error occurred during this process, the function returns the counter reading value before resetting the counter.
Numbers of the universal inputs ranging from 0 up to DP_UI_CNT-1
Number of universal inputs, with which the device is equipped
Sets the charge mode.
Activates malfunction monitoring for the supply or charging voltage V IN and specifies the function that should be called up in the event of the supply or charging voltage V IN failing.
Deactivates malfunction monitoring for the supply or charging voltage V IN
Provides information on the energy source used and power management status
Reads the current state of the Coulomb counter (electric charge) that can be used for the application derived from the system's internal Coulomb counter
Information on the energy source used and power management status
Saves the transferred configuration data for the external SIM card in the device. Setting the configuration data switches to the external SIM card. To switch back to the internal SIM chip, a structure, in which all of the fields are set to 0, must be transferred when setting the configuration data.
Provides the current configuration data stored for the external SIM card.
Configuration data of an external SIM card
Standard library for the rapidM2M Studio ecosphere
Activates the switchable sensor supply VOUT. The output voltage can be selected via the "mode" parameter.
Deactivates the switchable sensor supply VOUT.
Activates the switchable 3,3V supply voltage VEXT.
Deactivates the switchable 3,3V supply voltage VEXT.
Activates the switchable sensor supply VOUT. The output voltage (5...24V ) can be selected via the "mode" parameter.
Activates the switchable 3,3V supply voltage VEXT_RS232
Deactivates the switchable 3,3V supply voltage VEXT_RS232
Reads the last valid values for the "Internal housing temperature" and "Air humidity in the housing" from the system. The interval for determining these values is 10sec. and cannot be changed.
Internal measurement values
Init and configure external temperature sensing module
Closes the PT100/1000 interface.
Reads the temperature measurement value for the specified PT100/1000 interface from the temperature module.
Number of temperature sensor interfaces, with which the device is equipped
Number of temperature sensor interfaces, ranging from 0 to DP_TEMP_CNT-1
Initialises the isolated switch contact (NO, CC).
Only a multiple of the sample rate for the universal inputs selected via the UI_SetSampleRate() function can be set for the pulse duration in "Pulse/min." mode. The actual pulse duration is calculated as follows:
Deactivates the isolated switch contact (NO, CC)
Specifies the setpoint for the isolated switch contact (NO, CC).
Note that the maximum number of pulses that can be issued per minute is dependent on the pulse duration specified via the DigOut_Init() function:
Pulse duration = (cfg1/sample rateUI + 1) x sample rateUI
The time required to issue the specified number of pulses is dependent on the pulse duration and pulse pause specified via the DigOut_Init() function:
Number of the digital output (isolated switch contact), ranging from 0 to DP_DIGOUT_CNT-1
Number of digital outputs, with which the device is equipped
Initialises the RS232 interface
Closes the RS232 interface
Sends data via the specified RS232 interface
Provides the firmware with one buffer for sending and one for receiving characters via the RS232 interface from the RAM area reserved for the Device Logic. When this function is called, the system switches from the 256 byte buffers integrated in the firmware to the transferred buffers.
Number of the RS232 port ranging from 0 to DP_RS232_CNT-1
Initialises the RS485 interface
Closes the RS485 interface
Sends data via the specified RS485 interface
Provides the firmware with one buffer for sending and one for receiving characters via the RS485 interface from the RAM area reserved for the Device Logic. When this function is called, the system switches from the 256 byte buffers integrated in the firmware to the transferred buffers.
Number of the RS485 port ranging from 0 to DP_RS485_CNT-1
Initialises the solenoid switch
Deactivates the solenoid switch. An action is no longer initiated when the button is pressed.
Initialises the two-colour LED
Deactivates the two-colour LED.
The two-colour LED consists of a red and a green LED that can be switched on separately by this function. If both LEDs are switched on simultaneously, the two-colour LED lights up orange.
The two-colour LED consists of a red and a green LED that can be switched off separately by this function.
Enables the two-colour LED to flash (ton = 500ms , toff = 500ms ).
Enables the two-colour LED to briefly flash every 500ms.
Enables the two-colour LED to flicker (ton = 94ms , toff = 31ms ).
Control universal input modes and sample rate, reset counter value and get current value.
Initialises an universal input (UI 1 - UI 4). The sample rate for acquiring the measurement value is configured by the UI_SetSampleRate() function. Calling up the UI_SetSampleRate() function is only necessary, if the default sample rate setting of 16Hz (62,5ms) is not suitable for your application.
Time in [ms] during which the signal must remain constant to initiate a level change. Used to suppress brief faults (debouncing).
Time in [ms] during which the analogue signal is averaged for signal smoothing. Used to suppress signal noise.
Deactivates an universal input (UI 1 - UI 4).
Reads the last valid measurement value for the specified universal input from the system.
Sets the sample rate for the measurement value acquisition at the universal inputs. The specified setting is always valid for all of the universal inputs. Special settings for individual universal inputs are not possible. The default value of the sample rate is 16Hz (62,5ms).
Resets the counter reading of an universal input that is being operated in "Counter" mode. If no error occurred during this process, the function returns the counter reading value before resetting the counter.
Numbers of the universal inputs ranging from 0 up to DP_UI_CNT-1
Number of universal inputs, with which the device is equipped
Sets the charge mode.
Activates malfunction monitoring for the supply or charging voltage V IN and specifies the function that should be called up in the event of the supply or charging voltage V IN failing.
Deactivates malfunction monitoring for the supply or charging voltage V IN
Provides information on the energy source used and power management status
Reads the current state of the Coulomb counter (electric charge) that can be used for the application derived from the system's internal Coulomb counter
Information on the energy source used and power management status
Saves the transferred configuration data for the external SIM card in the device. Setting the configuration data switches to the external SIM card. To switch back to the internal SIM chip, a structure, in which all of the fields are set to 0, must be transferred when setting the configuration data.
Provides the current configuration data stored for the external SIM card.
Configuration data of an external SIM card
Standard library for the rapidM2M Studio ecosphere
Pin | Function 1 | Function 2 | Function 3 | Function 4 |
---|---|---|---|---|
P0.00 | reserved | |||
P0.01 | reserved | |||
P0.02 | reserved | |||
P0.03 | reserved | |||
P0.04 | GPIO 4 | UART 0 TX | SPI 0 MISO | I2C 0 SDA |
P0.05 | GPIO 5 | UART 0 RX | SPI 0 MOSI | I2C 0 SCL |
P0.06 | GPIO 6 | UART 0 CTS | SPI 0 CLK | |
P0.07 | GPIO 7 | UART 0 RTS | ||
P0.08 | GPIO 8 | UART 1 TX | SPI 1 MISO | I2C 1 SDA |
P0.09 | GPIO 9 | UART 1 RX | SPI 1 MOSI | I2C 1 SCL |
P0.10 | GPIO 10 | UART 1 CTS | SPI 1 CLK | |
P0.11 | GPIO 11 | UART 1 RTS | ||
P0.12 | GPIO 12 | |||
P0.13 | GPIO 13 | Analog IN 0 | ||
P0.14 | GPIO 14 | Analog IN 1 | ||
P0.15 | GPIO 15 | Analog IN 2 | ||
P0.16 | GPIO 16 | Analog IN 3 | ||
P0.17 | GPIO 17 | Analog IN 4 | ||
P0.18 | GPIO 18 | Analog IN 5 | ||
P0.19 | GPIO 19 | Analog IN 6 | IRQ 0 | |
P0.20 | GPIO 20 | Analog IN 7 | IRQ 1 | |
P0.21 | GPIO 21 | IRQ 2 | ||
P0.22 | GPIO 22 | IRQ 3 | ||
P0.23 | GPIO 23 | IRQ 4 | ||
P0.24 | reserved | |||
P0.25 | reserved | |||
P0.26 | GPIO 26 | IRQ 5 | ||
P0.27 | Sys Button | |||
P0.28 | Sys LED | |||
P0.29 | GPIO 29 | PWM 0 CHNL 0 | ||
P0.30 | GPIO 30 | PWM 1 CHNL 0 | ||
P0.31 | GPIO 31 | PWM 2 CHNL 0 |
Sets the pin mode for a GPIO.
Pin mode settings for the GPIOs
Available NRF91 pins
Sets the signal direction for a GPIO.
-1 | Resistor deactivated |
RM2M_GPIO_INPUT_PULLDOWN | Pull-down resistor activated |
RM2M_GPIO_INPUT_PULLUP | Pull-up resistor activated |
Value | Type of output | Initial output level | Internal resistor |
---|---|---|---|
-1 | Push-pull | last set output level | deactivated |
RM2M_GPIO_OUTPUT_LOW | Push-pull | "low" | deactivated |
RM2M_GPIO_OUTPUT_HIGH | Push-pull | "high" | deactivated |
RM2M_GPIO_OUTPUT_OD | Open-drain | "high" | deactivated |
RM2M_GPIO_OUTPUT_OD_PULLUP | Open-drain | "high" | pull-up |
RM2M_GPIO_OUTPUT_OS | Open-source | "low" | deactivated |
RM2M_GPIO_OUTPUT_OS_PULLDOWN | Open-source | "low" | pull-down |
Set the output level of a GPIO that was configured as an output.
Read the signal level of a GPIO that was configured as an input.
Number of GPIO pin, ranging from 0 (= first GPIO of the device) to DP_GPIO_CNT-1
Signal direction settings of the GPIOs
Signal levels of the GPIOs
Options for Gpio direction INPUT used with rM2M_GpioDir()
Options for Gpio direction OUTPUT used with rM2M_GpioDir()
Configure/Deconfigure a GPIO for interrupt functionality.
Number of interrupt, ranging from 0 (= first interrupt of the device) to DP_IRQ_CNT-1
Activates the interrupt functionality of an interruptible pin.
Edge and resistor configuration for the rM2M_IrqInit() function
Deactivates the interrupt functionality of an interruptible pin.
Default pin assignment for the interrupts.
Number of IRQ pin, ranging from 0 (= first interruptible pin of the device) to DP_IRQ_CNT-1
Provides the firmware for the selected UART interface with a sending and/or receiving buffer from the RAM area reserved for the device logic. When this function is called up, the system switches from the two buffers integrated in the firmware to the passed buffers.
Initialises the UART interface.
Closes the UART interface.
Sends data via the specified UART interface.
Sends a string via the specified UART interface.
Number of the UART port ranging from 0 (= first UART interface of the device) to DP_UART_CNT-1
Configure/Deconfigure the pin assignment for the given UART instance
Default pin assignment for the UART instances.
Initialises the I²C interface.
Closes the I²C interface.
Executes an I²C communication. Data is first of all sent and data is then received.
Number of the I²C port ranging from 0 (=first I²C interface of the device) to DP_I2C_CNT-1
Error codes of the rM2M_I2cCom() function
Configure/Deconfigure the pin assignment for the given i2c instance
Default pin assignment for the I2C instances.
Initialises the SPI interface.
Clock polarity: Idle "high"
Clock phase: Data are adopted at the first edge
SPI clock polarity and phase configuration
Closes the SPI interface.
Executes an asynchronous SPI communication. Data is first of all sent and data is then received.
Number of the SPI port ranging from 0 (= first SPI interface of the device) to DP_SPI_CNT-1
Configure/Deconfigure the pin assignment for the given SPI instance
Default pin assignment for the SPI instances.
Initialises the solenoid switch which is connected to P0.27
Deactivates the solenoid switch. An action is no longer initiated when the button is pressed.
Controls the system LED which is connected to P0.28
Triggers a single ADC conversion for the specified analog channel and returns the result of the measurement in [mV] (max. 3600mV, 12Bit resolution).
Numbers of the analog input channels available at the NRF91, ranging from 0 (=for the first analog input of the device) to DP_AIN_CNT-1
GPIO pin with analog capabilities
Initializes a PWM instance. Each PWM instance contains 4 PWM channels. The channels can each be assigned to a GPIO using NRF91_PwmConfigChannel().
Assigns/Deassign a GPIO for one of the 4 PWM channels of a PWM instance.
Sets the duty cycle for one of the 4 channels of a PWM instance.
Closes a PWM instance
Numbers of PWM instances available at the NRF91, ranging from 0 (=for the first PWM instance of the device) to DP_PWM_CNT-1
Available PWM channels per PWM instance.
Default pin assignment for channel 0 of each PWM instance.