Example #1
0
   // --------------------------------------------------------------------
   void init(Os::AppMainParameter& amp)
   {
      debug_.debug( "Hello!\n" );
      radio.enable_radio();
      radio.connect_radio(0);
      radio.reg_recv_callback<ExampleApplication, &ExampleApplication::onReceive>(this);
      while ( 1 )
      {
	if ( serialEventRun )
	  serialEventRun();
	if(wiselib::ArduinoTask::tasks_.empty());
	else
	{
	  wiselib::ArduinoTask t = wiselib::ArduinoTask::tasks_.front();
	  wiselib::ArduinoTask::tasks_.pop();
	  t.callback_(t.userdata_);
	  delay(10);
	}
      }
   }
Example #2
0
 void onReceive(Os::XBeeRadio::node_id_t id, Os::XBeeRadio::size_t len,Os::XBeeRadio::block_data_t* data)
 {
   debug.debug((char*)data);
 }