user15630: As picture below, how to use get_properties ? I fail to understand AN625, how to use get_properties to get RSSI ?


Adding source code based on RH_RF24 functions.

#include <SPI.h>
#include <RH_RF24.h>

// Singleton instance of the radio driver
RH_RF24 rf24;


uint8_t Recieve_Data[20];

uint8_t receive_buffer[RH_RF24_MAX_MESSAGE_LEN];
uint8_t receive_buffer_length = sizeof(receive_buffer);

uint8_t Rssi;

unsigned long Micro_Time;

uint8_t status[8];
uint8_t buf[RH_RF24_MAX_MESSAGE_LEN];
uint8_t len = sizeof(buf);

void setup()
{
  Serial.begin(115200);
  if (!rf24.init())
    Serial.println("init failed");
  // Defaults after init are 434.0MHz, modulation GFSK_Rb5Fd10, power 0x10
   while(!rf24.setFrequency(443));
  rf24.setModemConfig(rf24.GFSK_Rb50Fd100);  //设置成GFSK_Rb50Fd100
}


void loop()
{
  rf24.setModeRx();
  delay(100);
  rf24.setModeIdle();
  rf24.command(RH_RF24_CMD_GET_INT_STATUS, NULL, 0, status, sizeof(status));
  Serial.print("Id   ");
  for (int i = 0; i <= 8; i++)
  {
    Serial.print((uint8_t)status[i]);
    Serial.print("   ");
  }
  Serial.println();
  /*
    if (status[2])
    {
      uint8_t modem_status[6];
      rf24.command(RH_RF24_CMD_GET_MODEM_STATUS, NULL, 0, modem_status, sizeof(modem_status));
      delay(100);
      for (int i = 0; i <= 6; i++)
      {
        Serial.print(modem_status[i]);
        Serial.print("   ");
      }
      Serial.println();
    }
  */
  delay(400);
}


user28551: By using the RH_RF24 rf24;(Singleton instance of the radio driver), read a series of properties is really simple.

The properties shall be in the same GROUP,
Up to 16 properties could be read in the same request,


Hereafter is a example to read from SYNC_CONFIG to SYNC_BITS_7_0 (5
  properties).

Step 1 - Declare your own uint8_t sync_stat[5]; or use the still declared uint8_t status[8];.
 uint8_t sync_stat[5];

Step 2 - The firstProperty is in fact the first property to be read and count is the number successive properties to be read (from SYNC_CONFIG = 0x1100 to SYNC_BITS_7_0 = 0x1104.
// And check the returned code
if (rf24.get_properties(SYNC_CONFIG,sync_stat,5)) {
    // sync_stat[0]= SYNC_CONFIG
    // ...
    // sync_stat[4]= SYNC_BITS_7_0
}


Then, the equivalent command() is:

uint8_t buf[3];
buf[0] = SYNC_CONFIG >> 8;
buf[1] = 5;
buf[2] = SYNC_CONFIG & 0xff;
if (rf24.command(RH_RF24_CMD_GET_PROPERTY, buf, sizeof(buf),sync_stat,5)) {
    // Same array
}


15630: <p>As picture below, how to use get_properties ? I fail to understand <a href="http://community.silabs.com/mgrfq63796/attachments/mgrfq63796/BluetoothandWiFi/8086/1/Si446X%20API%20DESCRIPTIONS.pdf" rel="nofollow noreferrer">AN625</a>, how to use get_properties to get RSSI ?</p>
<blockquote>
<p><a href="https://i.stack.imgur.com/i6j6w.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/i6j6w.png" alt="enter image description here" /></a></p>
<p>Adding source code based on RH_RF24 functions.</p>
</blockquote>
<pre><code>#include &lt;SPI.h&gt;
#include &lt;RH_RF24.h&gt;

// Singleton instance of the radio driver
RH_RF24 rf24;


uint8_t Recieve_Data[20];

uint8_t receive_buffer[RH_RF24_MAX_MESSAGE_LEN];
uint8_t receive_buffer_length = sizeof(receive_buffer);

uint8_t Rssi;

unsigned long Micro_Time;

uint8_t status[8];
uint8_t buf[RH_RF24_MAX_MESSAGE_LEN];
uint8_t len = sizeof(buf);

void setup()
{
  Serial.begin(115200);
  if (!rf24.init())
    Serial.println(&quot;init failed&quot;);
  // Defaults after init are 434.0MHz, modulation GFSK_Rb5Fd10, power 0x10
   while(!rf24.setFrequency(443));
  rf24.setModemConfig(rf24.GFSK_Rb50Fd100);  //设置成GFSK_Rb50Fd100
}


void loop()
{
  rf24.setModeRx();
  delay(100);
  rf24.setModeIdle();
  rf24.command(RH_RF24_CMD_GET_INT_STATUS, NULL, 0, status, sizeof(status));
  Serial.print(&quot;Id   &quot;);
  for (int i = 0; i &lt;= 8; i++)
  {
    Serial.print((uint8_t)status[i]);
    Serial.print(&quot;   &quot;);
  }
  Serial.println();
  /*
    if (status[2])
    {
      uint8_t modem_status[6];
      rf24.command(RH_RF24_CMD_GET_MODEM_STATUS, NULL, 0, modem_status, sizeof(modem_status));
      delay(100);
      for (int i = 0; i &lt;= 6; i++)
      {
        Serial.print(modem_status[i]);
        Serial.print(&quot;   &quot;);
      }
      Serial.println();
    }
  */
  delay(400);
}
</code></pre>
 28551: <p>By using the <code>RH_RF24 rf24;</code>(Singleton instance of the radio driver), read a series of properties is really simple.</p>

<ul>
<li>The properties shall be in the same GROUP,</li>
<li>Up to 16 properties could be read in the same request,</li>
</ul>

<blockquote>
  <p>Hereafter is a example to read from <code>SYNC_CONFIG</code> to <code>SYNC_BITS_7_0</code> (5
  properties).</p>
</blockquote>

<p><strong>Step 1</strong> - Declare your own <code>uint8_t sync_stat[5];</code> or use the still declared <code>uint8_t status[8];</code>.</p>

<pre><code> uint8_t sync_stat[5];
</code></pre>

<p><strong>Step 2</strong> - The <code>firstProperty</code> is in fact the first property to be read and <code>count</code> is the number successive properties to be read (from <code>SYNC_CONFIG = 0x1100</code> to <code>SYNC_BITS_7_0 = 0x1104</code>.</p>

<pre><code>// And check the returned code
if (rf24.get_properties(SYNC_CONFIG,sync_stat,5)) {
    // sync_stat[0]= SYNC_CONFIG
    // ...
    // sync_stat[4]= SYNC_BITS_7_0
}
</code></pre>

<blockquote>
  <p>Then, the equivalent <code>command()</code> is:</p>
</blockquote>

<pre><code>uint8_t buf[3];
buf[0] = SYNC_CONFIG &gt;&gt; 8;
buf[1] = 5;
buf[2] = SYNC_CONFIG &amp; 0xff;
if (rf24.command(RH_RF24_CMD_GET_PROPERTY, buf, sizeof(buf),sync_stat,5)) {
    // Same array
}
</code></pre>
