예제 #1
0
void ReTune(int Channel, double FreqShift)
{
	setMode(Channel, RF96_MODE_SLEEP);
	LogMessage("Retune by %lf kHz\n", FreqShift * 1000);
	setFrequency(Channel, Config.LoRaDevices[Channel].activeFreq + FreqShift);
	startReceiving(Channel);
}
예제 #2
0
void DccTransferRecv::slotServerSocketReadyAccept()
{
    //stopConnectionTimer()

    m_recvSocket = static_cast<KNetwork::KStreamSocket*>( m_serverSocket->accept() );
    if ( !m_recvSocket )
    {
        failed( i18n( "Could not accept the connection. (Socket Error)" ) );
        return;
    }

    connect( m_recvSocket, SIGNAL( gotError( int ) ), this, SLOT( connectionFailed( int ) ) );

    // we don't need ServerSocket anymore
    m_serverSocket->close();

    startReceiving();
}
예제 #3
0
void setupRFM98(int Channel)
{
	if (Config.LoRaDevices[Channel].InUse)
	{
		// initialize the pins
		pinMode(Config.LoRaDevices[Channel].DIO0, INPUT);
		pinMode(Config.LoRaDevices[Channel].DIO5, INPUT);

		if (wiringPiSPISetup(Channel, 500000) < 0)
		{
			fprintf(stderr, "Failed to open SPI port.  Try loading spi library with 'gpio load spi'");
			exit(1);
		}

		// LoRa mode 
		setLoRaMode(Channel);

		SetDefaultLoRaParameters(Channel);
		
		startReceiving(Channel);
	}
}
예제 #4
0
/**
 * \brief wavrUdpNetwork::start
 *  Starts listening to incoming datagrams and receiving them.
 *  Initializes isRunning to true.
 */
void wavrUdpNetwork::start(void) {
    //  start receiving datagrams
    canReceive = startReceiving();
    isRunning = true;
}