PreviousNext
Send
Help > Peripherals > FRC > Send

This command starts the Fast Response Command (FRC) process supported by IQRF OS. It allows quick and using only one request to collect the same type of information (data length) from multiple Nodes in the network. The type of the collected information is specified by a byte called the FRC command. Currently, IQRF OS allows collecting either 2 bits from all (up to 239) Nodes, 1 byte from up to 63 Nodes (having logical addresses 1-63), 2 bytes from up to 31 Nodes (having logical addresses 1-31), or 4 bytes from up to 15 Nodes (having logical addresses 1-15). The type of collected data is specified by the FRC command value:

 

Type of collected data

FRC Command interval

Reserved interval

User interval

2 bits

0x00 - 0x7F

0x00 - 0x3F

0x40 - 0x7F

1 byte

0x80 - 0xDF

0x80 - 0xBF

0xC0 - 0xDF

2 bytes

0xE0 - 0xF7

0xE0 - 0xEF

0xF0 - 0xF7

4 bytes

0xF8 - 0xFF

0xF8 - 0xFB

0xFC - 0xFF

 

When 2 bits are collected, then the 1st bits from the Nodes are stored in the bytes of index 0-29 of the output buffer, 2nd bits from the Nodes are stored in the bytes of index 32-61.

 

When 1 byte is collected then bytes from each [N] (1-63) are stored in bytes 1-63 of the output buffer.

 

When 2 bytes are collected then byte pairs for each [N] (1-31) are stored in bytes 2-63 of the output buffer.

 

When 4 bytes are collected then byte foursomes for each [N] (1-15) are stored in bytes 4-63 of the output buffer.

 

For more information see IQRF OS manuals. If the [N] does not return an FRC value for some reason, then either returned bits or bytes are equal to 0. This is why it is necessary to code the zero return value into a non-zero one.

 

The time when the response is delivered depends on the type of the FRC command and used RF mode. Consult IQRF OS guides for the response time calculation and the IQMESH Timing Calculator.

 

Request

 

NADR

PNUM

PCMD

HWPID

0

1 … n

NADR

0x0D

0x00

?

FrcCommand

UserData

 

FrcCommand                Specifies data to be collected.

UserData                      User data that are available at IQRF OS array variable DataOutBeforeResponseFRC at FRC Value event. The length n is from 2 to 30 bytes. Unused user data is null when received by the node.

Response

 

NADR

PNUM

PCMD

HWPID

ErrN

DpaValue

0

1 n

NADR

0x0D

0x80

?

0

?

Status

FrcData

 

Status              Return code of the sendFRC IQRF OS function (typically number of responding [Ns]). See IQRF OS documentation for more information.

FrcData            Data collected from the Nodes. Because the current version of DPA cannot transfer the whole FRC output buffer at once (currently only up to 55 bytes), the remaining bytes of the buffer can be read by the next described Extra result command.

 

The following video depicts a FRC communication in the IQMESH network.


 3.14.2.1             Source code support

typedef struct

{

  uns8 FrcCommand;

  uns8 UserData[30];

} TPerFrcSend_Request;

 

TPerFrcSend_Request _DpaMessage.PerFrcSend_Request;

 

typedef struct

{

  uns8 Status;

  uns8 FrcData[DPA_MAX_DATA_LENGTH - sizeof( uns8 )];

} TPerFrcSend_Response;

 

TPerFrcSend_Response _DpaMessage.PerFrcSend_Response;