sendPacket.cpp
Go to the documentation of this file.
00001 #include <iostream>
00002 
00003 #include <crazyflie_cpp/Crazyradio.h>
00004 
00005 int main()
00006 {
00007   Crazyradio radio(0); // Instantiate an object bound to the first Crazyflie found
00008   radio.setChannel(100); // Update the base frequency to 2500 MHz
00009   radio.setAddress(0xE7E7E7E701); // Set the address to send to
00010   radio.setDatarate(Crazyradio::Datarate_2MPS);
00011   // Send a packet
00012   uint8_t data[] = {0xCA, 0xFE};
00013   Crazyradio::Ack ack;
00014   radio.sendPacket(data, sizeof(data), ack);
00015   if (ack.ack) {
00016     std::cout << "Ack of size " << ack.size << " received!" << std::endl;
00017   } else {
00018     std::cout << "No Ack received!" << std::endl;
00019   }
00020 
00021   return 0;
00022 }


crazyflie_cpp
Author(s): Wolfgang Hoenig
autogenerated on Sun Oct 8 2017 02:47:59