OakLib 1.2 to 1.3 Migration Guide

With the 1.3 version of the OakLib, Toradex has introduced some changes in the programming interface of the library. In most cases, migrating your application is simply a matter of recompiling and linking your application against the new version of the library, but in some cases (mainly if you are using a programming language that offers no easy bridging feature with C DLLs), you may need to tweak your code to be able to use the version 1.3 of the OakLib. This document will detail the motivation behind the changes, and tell you how to adapt your code.

In versions prior to 1.3, the OakLib used 'ALIGN' compiler directives to control the padding in data structures. In a few words, in order to optimize performance, the compiler can insert 'gaps' in data structure so that data members are optimally aligned for CPU operations. The programming languages makes sure the padding is made transparent to the user, and in most cases, you do not have to worry about padding. You can find more details about the topic in the following article.
'align' compiler directives that give control over the padding have been removed in OakLib 1.3, and data structures now use the default padding policy for the x86 platform. In practice, this means that the tChannel structure remains the same as in 1.2 and all padding bytes are removed from the tOakSensor structure (see the tables below for details).

Other languages: if you previously had to manually specify the padding in your application, modify your code to match the structure in the following tables. Otherwise, simply recompile your application.