title: Z-wave protocol with C: Questions about Z-wave frame structure & programming in general
body: <p>(Before I ask my question; I don't really know if anyone is allowed to answer my question since the Z-wave protocol is supposed to be confidential information, but if it does indeed violate against any kind of regulation then feel free to delete this post.)</p>
  <p>I am currently trying to write a C program that simply constructs a Z-wave message consisting of raw binary data and then sends that message to a USB interface where a Z-wave controller is connected (I am using the AEOTEC Z-Stick USB dongle by Aeon Labs). I am also using <a href="http://www.digiwave.dk/en/programming/an-introduction-to-z-wave-programming-in-c/" rel="noreferrer" title="Z-wave programming tutorial using C#">this</a> guide as a reference and trying to re-write the sample code in plain C. However, if you take a look at the guide, specifically the message he is trying to send to the USB controller:</p>
  <pre><code>/*
  0x01, 0x09, 0x00, 0x13, nodeId, 0x03, 0x20, 0x01, state, 0x05, checksum
  */
  </code></pre>
  <p>... maybe it's just me but it seems like some information from the usual Z-wave frame is missing. My guess is that the first 4 bytes represent the Home ID followed by the node ID, but I can't make out what the '0x03' means after that, supposing that the rest after that byte represent the &quot;Basic&quot; command class ('0x20', 1 byte) and the corresponding &quot;Set&quot; application command ('0x01', 1 byte). And what does the '0x05' stand for before the checksum bit? And what about the transport header information, why isn't it included? It seems like he didn't need to include it... or maybe I'm just interpreting the packet completely wrong. Can someone enlighten me please?</p>
  <p>Also, is it correct that you can only retrieve application-layer information fom the USB port if you read from it (f.ex. with a open() &amp; read() command in C)?</p>
  <p>Thank you in advance!</p>