Texus's Blog RSS icon

IEEE 802.15.4 Sniffer for OpenMote-CC2538

For my first research intership that is part of my Masters in Computer Science study I wrote a sniffer for IEEE 802.15.4 networks which is written to run on the OpenMote-CC2538 hardware.


  • The sniffer is lossless, all packets are captured
  • The captured packets can be monitored real-time in Wireshark (or can be written to a pcap file)
  • The sniffer is cross-platform, it will work on Windows, Linux and Mac OS X
  • You can either show the FCS or replace it with the RSSI, LQI and an FCS Valid bit
  • CRC checks and retransmissions are used on the serial connection to avoid possible corruption between the peripheral and host

For more information, check the README in the github repository.

Debugging on OpenMote-CC2538 with J-Link (using nemiver)

After trying for several days to get debugging working in Eclipse, I was told that it would be easier to use nemiver. I tried it and worked on the first try without any problems. This post will show the easy steps necessary to debug the code running on the OpenMote hardware.

My setup is the following: a linux pc (running Arch Linux), the SEGGER J-Link EDU, the OpenMote-CC2538 and the OpenBase to connect the mote to the pc. Also an ARM-JTAG-20-10 adaptor was used to connect the J-Link to the JTAG on the OpenBase.

Read more

Using parallel_for from Intel TBB

This post will show an example of the parallel_for function from the Intel TBB library. Every part of the code is well commented to explain what it does. Below the example you will find other explanations on how to improve the code and how to avoid the bad programming practices that were used in the example to keep it simple.

Read more

CMake and Gcov

While trying to use Gcov for my project I noticed that it doesn’t work well together with CMake. The problem is that CMake generates files named file.cpp.gcno while gcov searches for file.gcno. Luckily, there is an easy solution.

Read more

Converting string to lowercase at compile time with c++14

With the addition of the constexpr keyword in c++11 it is possible to calculate the result of function calls on compile time. I knew that it was possible to e.g. count the brackets in a string, but I wanted to take things a little bit further, I wanted to change the string.

I failed at doing this about a year ago, but now that I just updated to gcc 5.2, I decided to give it another shot.

Read more

std::bind for unknown variable

I find the std::bind function a very cool thing, it allows storing functions with different parameters in the same list. But you can even do bind calls within bind calls so that at the moment you call the function it will first execute another function and then passing the result as parameter to the function that you call.

But what if you need to bind a parameter to the function but you don’t know yet what variable should be bound? You could use a pointer as parameter and then later set the pointer to the variable of course. But although I will use a pointer I will have it dereference automatically before the function is actually called.

Read more

Cross-platform custom-shaped windows

This post will explain how to create transparent (non-rectangular) windows in c++ on Windows, Linux and Mac OS X. The shape of the window will be determined by an image with a transparent background. If the pixel is transparent then it will not be part of the window. It is assumed that the size of the image and the size of the window are the same.

Each operating system requires different code and will be discussed separately. Below you will find code snippets, but for a full example check this github project which creates a window with a custom shape with SFML.

Read more