PreviousNext
sendFRC
Help > OS functions > Networking > sendFRC

Function

 

Requesting a fast response (Fast Response Command, FRC) by the Coordinator and receiving fast answer and data from more (or all) Nodes

Purpose

 

Receive a fast answer and collect data from Nodes

Syntax

 

uns8 sendFRC(uns8 command)   

Parameters

 

command: User command to be received by Nodes. It is copied to PCMD on the Node side.

     command.7 = 0         Requests data in bit mode (2 bits from all Nodes)

     command.7 = 1         Requests data in byte mode (1 B, 2 B or 4 B from specified Nodes)

     command.0 to .6         User-specific (possibly closer specifying the FRC command)

Input values

 

     configFRC:

       configFRC.0  Selective mode requested

              configFRC.1       2B mode requested

              configFRC.2       4B mode requested

              configFRC.3       Not documented

       configFRC.4-6 Extra time requested on Nodes’ side

       configFRC.7  For internal use only, keep zero

The configFRC register is automatically cleared after sendFRC finishing.

     The 30 B  array DataInSendFRC of the Coordinator can be specified. This array will be copied to the DataOutBeforeResponseFRC array of all Nodes which received FRC.

     bufferINF0[0-29]: For selective FRC only. The bit array specifying (by log. 1) selected Nodes in following order:

    bufferINFO[0].0 – unused, bufferINFO[0].1 – N1, …,  bufferINFO[0].7 – N7,

    bufferINFO[1].0 – N8, bufferINFO[1].1 – N9, …,  bufferINFO[29].7 – N239

              Only bonded Nodes are allowed to be selected.

Return value

 

     0x000xEF               FRC successful. Number of Nodes replying (adding values to FRC                                               response). Just non-zero values are counted.

     0xF00xFC               Reserved

     0xFD                           FRC unsuccessful. Immediate return: max. number of selected Nodes                                            (specified in bit array) allowed for selective FRC exceeded

                                           (> 63 b for 1B FRC, > 31 b for 2B FRC or > 15 b for 4B FRC).

     0xFE                           FRC unsuccessful. Immediate return in case of EEPROM non-consistency                                            (e.g. not initialized EEPROM by clearAllBonds before new                                               bonding). For bit pairs collected only.

     0xFF                           FRC unsuccessful, no Nodes are bonded

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Output values

 

     param2: Number of requested Nodes

     Collected data is stored in bufferINFO (if properly answered by the Nodes)

  When bits pairs are collected, the 1st bits from the Nodes are stored in the bytes indexed 0-29 of    the bufferINFO, 2nd bits from the Nodes are stored in the bytes indexed 32-61.

          Bit.0 in bufferINFO[0] and bufferINFO[32] is not used.

                           bufferINFO[0]                                   bufferINFO[1] ...

                            7    6    5   4    3   2    1   0               7      6      5      4     3     2     1    0

         1st bit of:   N7 N6 N5 N4 N3 N2 N1  -             N15  N14 N13 N12 N11 N10 N9 N8

 

         ... bufferINFO [32]                            bufferINFO[33] ...

                            7    6    5   4    3   2    1   0              7      6      5      4     3     2     1    0

          2nd bit of: N7 N6 N5 N4 N3 N2 N1  -            N15  N14 N13 N12 N11 N10 N9 N8

            For selective FRC, only values corresponding to selected Nodes are valid.

 

  In 1B mode, collected data is stored at bytes 1-63 of the bufferINFO. bufferINFO[0] is not used.

         bufferINFO [0]  [1]  [2]  [3]  [4]

                                 -   N1  N2 N3  N4 ...           For non-selective FRC.

                                 -   S1  S2  S3  S4 ...           For selective FRC. S1 … S63 mean up to 63 selected         Nodes (selected from N1 to N239 by the bit array, see Input values).

 

         In 2B mode, collected data (little endian) is stored at bytes 2-63 of the bufferINFO. bufferINFO[0] and [1] are not used.

     bufferINFO [0]  [1]  [2]  [3]  [4]  [5] … 

                             -     -      N1        N2   …          For non-selective FRC.

                             -     -      S1        S2   …          For selective FRC. S1 … S31 mean up to 31 selected      Nodes (selected from N1 to N239 by the bit array, see Input values).

 

         In 4B mode, collected data (little endian) is stored at bytes 4-63 of the bufferINFO. bufferINFO[0] to [3] are not used.

     bufferINFO [0]  [1]  [2]  [3]  [4]  [5]  [6]  [7]  [4]  [5]  [6]  [7]   … 

                             -     -     -    -    . . . .  N1 . . . .   . . . .  N1 . . . .   …         For non-selective FRC.

                             -     -     -    -    . . . .  S1 . . . .    . . . . S2 . . . .   …         For selective FRC. S1 … S15             mean up to 15 selected Nodes (selected from N1 to N239 by the bit array, see Input values).

Remarks

 

This function is intended for internal use in the DPA framework only. It is not intended to be used in Custom DPA handler.