A Look Inside Your CPAP Machine

I've been diagnosed with sleep apnea, and after the first month or so, I went back to the doctors for a follow-up appointment. They asked me to bring along the ResMed CPAP machine, and the nurse showed me charts and information that they had gotten from the machine. Hmmm. How does that work?

I found that the machine has an SD card, and since I have an SD card reader on my iMac, I took it to the office to have a look around. Looking at the disk, I found this directory structure.

The SETTINGS folder has a bunch of files in it

Not sure what these things are, so I moved on and in the DATALOG directory, I found...

Each session of using the machine creates a folder of a number of related files, and in searching the internet I found that the .edf files are 'European Data Format' and you can find an open source browser at


Where you can find extensive information on the file formats, an EDFBrowser program that runs Linux and Windows. The programmer behind this is Teunis van Beelen, a Dutch electronics hardware designer who now lives and works in Turin, Italy. He's strictly a Linux user, and he says the Windows version of EDFBrowser was compiled on an old Windows XP machine installed within VirtualBox. Apparently you can compile the program on a Mac, but it looked too difficult for me, so I created a Mac Cocoa app following the design I've used for importing ShapeFiles in WildTools. The program has a window into which you can drag multiple .edf files.


CPAPTalk Forum and SleepyHead

Teunis pointed me to CPAPTalk forum at


which is largely focused on SleepyHead, a program written by Australian software developer Mark Watkins. Find SleepyHead at the download page


And there is an excellent

Beginner's Guide to SleepyHead

SleepyHead is the result of years of work by Mark Watkins. It is an outstanding, well designed and executed program that runs on Windows, MacOS and Ubuntu. It is also open source. I have downloaded and looked at the source code. It's largely written in C++, which I understand but it's overwhelming. I'm completely lost dealing with a monumental effort of cross-platform programming.

My design goals for Dragon Breath are very similar to SleepyHead, and I will be using it for comparison as a design guide but with completely new programming and with my own ideas on how things should be done.




Dragon Breath