FRC_MemoryRead = 0x82
Collects bytes. A resulting byte is read from the specified memory address after a provided DPA Request is executed. This allows getting one byte from any memory location (RAM, EEPROM and EEEPROM peripherals, Flash, MCU register, etc.). As the returned byte must not equal 0 there is also a Memory read plus 1 FRC command available.
Input FCR user data has the following content. Please note that DPA does not check the correct content or length of FRC user data. A batch request is not allowed to be a DPA Request being executed. Specified DPA Request is executed with an HWPID the [N] has.
0 … 1 |
2 |
3 |
4 |
5 … 6 - Length |
Memory address |
PNUM |
PCMD |
Length |
PData |
Memory address Memory address to read the byte from.
PNUM Peripheral number of executing DPA Request at.
PCMD Peripheral command.
Length Length of the optional DPA Request data.
PData Optional DPA Request Data.
Example 1
This example reads the OS version. OS Read DPA Request will be executed and then a byte from _DpaMessage.PerOSRead_Response.OsVersion variable (the request stores the result/response there) will be returned. The actual address of this byte is 0x4A4. See .h or .var files for details.
FRC command = FRC_MemoryRead = 0x82
Memory address = 0x4A4
PNUM = PNUM_OS = 0x02
CMD = CMD_OS_READ = 0x00
Length = 0 = No data bytes
PData none
Example 2
This example reads the value of the IQRF OS lastRSSI variable. Dummy OS Read DPA Request will be executed and then a byte from the lastRSSI variable will be returned. The actual address of this variable is 0x5B6. Open a generated .var file of any IQRF compiled project to find out an address of a system variable.
FRC command = FRC_MemoryRead = 0x82
Memory address = 0x5B6
PNUM = PNUM_OS = 0x02
CMD = CMD_OS_READ = 0x00
Length = 0 = No data bytes
PData none
Example 3
This example reads a lower byte of the HWPID version from more Nodes at once. Peripheral enumeration DPA Request is executed and the result byte is read. Address 0x4A9 points to lower byte of HWPID. Use an address from range 0x4A7 to 0x4AA to read any byte of HWPID or HWPID version respectively.
FRC command = FRC_MemoryRead = 0x82
Memory address = 0x4A9
PNUM = PNUM_ENUMERATION = 0xFF
CMD = CMD_GET_PER_INFO = 0x3F
Length = 0 = No data bytes
PData none
Example 4
This example returns a supply voltage level using an embedded OS Read command. See getSupplyVoltage at IQRF OS Reference Guide for the format of the return value.
FRC command = FRC_MemoryRead = 0x82
Memory address = 0x4A9
PNUM = PNUM_OS = 0x02
CMD = CMD_OS_READ = 0x00
Length = 0 = No data bytes
PData none