- Why first rawbuf element is ignored?
The first element is the time between the start of looking for a code and the time the code actually starts. It's has no meaning because it is just an accident of timing so it is generally ignored.
2)How is a ir protocol generally made? I mean is there a common structure?
Study the four protocols already supported by the library. Then study the raw data from your protocol to see how it differs from the supported protocols. Then you can base your protocol on the nearest supported protocol.