示例#1
0
void prepareForListening(const uint32_t *localAddress)
{
	if (RFM75_getMode() != MODE_PRX)
	{
		RFM75_setModeRX();
	}

	uint8_t adr[5];
	uint8_t i;
	for(i=0; i<5; i++){
		adr[i] = localAddress[i];
	}
	adr[4] = 0;
	if (!configRxPipe(1, adr, 0, 1))
	{
		// fprintf(stderr, "Can't configure Rx Pipe properly!\n");
	}
}
示例#2
0
void startListening(const uint32_t &localAddress)
{
  if (getMode() != MODE_PRX)
  {
    setModeRX();
  }

  uint8_t adr[5];
  memcpy(adr, &localAddress, 4);
  adr[4] = 0;
  if (!configRxPipe(1, adr, 0, 1))
  {
    Serial.println("ERROR: cannot config RX Pipe");
  }
  else
  {
    // Enable radio unit in the RFM73
    CE_HIGH;
  }
}