Announcing (unworking) C-language driver!

Firmware/software/electronics/mechanics
Post Reply
gherlein
Beginner
Posts: 11
Joined: Mon Jun 22, 2015 8:32 pm

Announcing (unworking) C-language driver!

Post by gherlein »

I've started a native C-language port of the interface to the CrazyRadio and CrazyFlie. Why? Because it's fun, and because I wanted to really understand how the low level stuff worked. I could have used the libcflie code (https://github.com/fairlight1337/libcflie) by Jan Winkler but I don't like C++ (understatement) and besides, I really wanted to learn.

The code is released GPL3 and it's here: https://github.com/gherlein/libcf2

This code is NOT yet working. I think I have it started sending packets to the cf2, but my reads of the ACK always only have one byte (status byte). I don't think this is right. If I use the python client and use the tool off the "View|Toolbox|Crtp Sniffer" and sending the same messages I don't get the same reply. So my code is still broken.

Assistance is welcome. Please just submit pull requests.
whoenig
Expert
Posts: 395
Joined: Mon Oct 27, 2014 2:55 am

Re: Announcing (unworking) C-language driver!

Post by whoenig »

Nice work! If you don't setup logging, most ACKs will be actually empty. (Except shortly after startup, where you will receive some logging messages as well).
The code for reading from the Crazyradio itself seems to be fine.

I worked on an improved C++ version, and you can take a look here: https://github.com/whoenig/crazyflie_ro ... yradio.cpp. I used C-style structs for the CRTP packets: https://github.com/whoenig/crazyflie_ro ... src/crtp.h.
Post Reply