Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 2aa62c5bbb658df1fece777472a7bcf2 > files > 2178

barry-devel-docs-0.17-0.3.20100730git.fc14.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Barry: protostructs.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.2-20100208 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="dir_65781e9408669bb8d7d9c025fdb5fe86.html">src</a>
  </div>
</div>
<div class="contents">
<h1>protostructs.h</h1><a href="protostructs_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">///</span>
<a name="l00002"></a>00002 <span class="comment"></span><span class="comment">/// \file       protostructs.h</span>
<a name="l00003"></a>00003 <span class="comment"></span><span class="comment">///             USB Blackberry bulk protocol API.  This is split out from</span>
<a name="l00004"></a>00004 <span class="comment"></span><span class="comment">///             protocol.h so that low level, packed structs can be</span>
<a name="l00005"></a>00005 <span class="comment"></span><span class="comment">///             compiled separately from the application.  This prevents</span>
<a name="l00006"></a>00006 <span class="comment"></span><span class="comment">///             aliasing problems in the application, or using</span>
<a name="l00007"></a>00007 <span class="comment"></span><span class="comment">///             -fno-strict-aliasing, which the library only needs.</span>
<a name="l00008"></a>00008 <span class="comment"></span><span class="comment">///</span>
<a name="l00009"></a>00009 <span class="comment"></span><span class="comment">///             Do not include this in any Barry library header.</span>
<a name="l00010"></a>00010 <span class="comment"></span><span class="comment">///             This may only be included from .cc files, in order</span>
<a name="l00011"></a>00011 <span class="comment"></span><span class="comment">///             to hide aliasing concernes from the application.</span>
<a name="l00012"></a>00012 <span class="comment"></span><span class="comment">///</span>
<a name="l00013"></a>00013 <span class="comment"></span>
<a name="l00014"></a>00014 <span class="comment">/*</span>
<a name="l00015"></a>00015 <span class="comment">    Copyright (C) 2005-2010, Net Direct Inc. (http://www.netdirect.ca/)</span>
<a name="l00016"></a>00016 <span class="comment"></span>
<a name="l00017"></a>00017 <span class="comment">    This program is free software; you can redistribute it and/or modify</span>
<a name="l00018"></a>00018 <span class="comment">    it under the terms of the GNU General Public License as published by</span>
<a name="l00019"></a>00019 <span class="comment">    the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00020"></a>00020 <span class="comment">    (at your option) any later version.</span>
<a name="l00021"></a>00021 <span class="comment"></span>
<a name="l00022"></a>00022 <span class="comment">    This program is distributed in the hope that it will be useful,</span>
<a name="l00023"></a>00023 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00024"></a>00024 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</span>
<a name="l00025"></a>00025 <span class="comment"></span>
<a name="l00026"></a>00026 <span class="comment">    See the GNU General Public License in the COPYING file at the</span>
<a name="l00027"></a>00027 <span class="comment">    root directory of this project for more details.</span>
<a name="l00028"></a>00028 <span class="comment">*/</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#ifndef __BARRY_PROTOSTRUCTS_H__</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#define __BARRY_PROTOSTRUCTS_H__</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;sys/types.h&gt;</span>
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <span class="comment">// forward declarations</span>
<a name="l00037"></a>00037 <span class="keyword">namespace </span>Barry { <span class="keyword">class </span>Data; }
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="keyword">namespace </span>Barry { <span class="keyword">namespace </span>Protocol {
<a name="l00040"></a>00040 <span class="comment"></span>
<a name="l00041"></a>00041 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00042"></a><a class="code" href="unionBarry_1_1Protocol_1_1SizePacket.html">00042</a> <span class="comment"></span><span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1SizePacket.html">SizePacket</a>
<a name="l00043"></a>00043 {
<a name="l00044"></a>00044         uint16_t size;
<a name="l00045"></a>00045         <span class="keywordtype">char</span> buffer[4];
<a name="l00046"></a>00046 } __attribute__ ((packed));
<a name="l00047"></a>00047 
<a name="l00048"></a>00048 <span class="comment"></span>
<a name="l00049"></a>00049 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00050"></a>00050 <span class="comment"></span><span class="comment">// Record sub-field structs</span>
<a name="l00051"></a>00051 
<a name="l00052"></a><a class="code" href="structBarry_1_1Protocol_1_1GroupLink.html">00052</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1GroupLink.html">GroupLink</a>                                <span class="comment">// used for Contacts records</span>
<a name="l00053"></a>00053 {
<a name="l00054"></a>00054         uint32_t        uniqueId;
<a name="l00055"></a>00055         uint16_t        unknown;
<a name="l00056"></a>00056 } __attribute__ ((packed));
<a name="l00057"></a>00057 
<a name="l00058"></a><a class="code" href="structBarry_1_1Protocol_1_1MessageAddress.html">00058</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1MessageAddress.html">MessageAddress</a>                           <span class="comment">// used for Message records</span>
<a name="l00059"></a>00059 {
<a name="l00060"></a>00060         uint8_t         unknown[8];
<a name="l00061"></a>00061         uint8_t         addr[1];        <span class="comment">// 2 null terminated strings: first</span>
<a name="l00062"></a>00062                                         <span class="comment">// contains full name, second contains</span>
<a name="l00063"></a>00063                                         <span class="comment">// the email address</span>
<a name="l00064"></a>00064 } __attribute__ ((packed));
<a name="l00065"></a>00065 
<a name="l00066"></a>00066 <span class="comment"></span>
<a name="l00067"></a>00067 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00068"></a>00068 <span class="comment"></span><span class="comment">// SMS Message field and record structures</span>
<a name="l00069"></a>00069 
<a name="l00070"></a><a class="code" href="structBarry_1_1Protocol_1_1SMSMetaData.html">00070</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1SMSMetaData.html">SMSMetaData</a>
<a name="l00071"></a>00071 {
<a name="l00072"></a>00072         uint8_t         recv; <span class="comment">// if received, this is set to 1; otherwise 0</span>
<a name="l00073"></a>00073         uint8_t         flags;
<a name="l00074"></a>00074 <span class="preprocessor">#define SMS_FLG_NEW_CONVERSATION 0x20</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span><span class="preprocessor">#define SMS_FLG_SAVED 0x10</span>
<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="preprocessor">#define SMS_FLG_DELETED 0x08</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">#define SMS_FLG_OPENED 0x01</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span>
<a name="l00079"></a>00079         uint8_t         new_flag;
<a name="l00080"></a>00080         uint16_t        zero; <span class="comment">// constantly 0</span>
<a name="l00081"></a>00081         uint32_t        status;
<a name="l00082"></a>00082 <span class="preprocessor">#define SMS_STA_RECEIVED 0x000007ff</span>
<a name="l00083"></a>00083 <span class="preprocessor"></span><span class="preprocessor">#define SMS_STA_DRAFT 0x7fffffff</span>
<a name="l00084"></a>00084 <span class="preprocessor"></span>
<a name="l00085"></a>00085         uint32_t        error_id;
<a name="l00086"></a>00086         uint64_t        timestamp;
<a name="l00087"></a>00087         uint64_t        service_center_timestamp;
<a name="l00088"></a>00088         uint8_t         dcs;
<a name="l00089"></a>00089 <span class="preprocessor">#define SMS_DCS_7BIT 0x00</span>
<a name="l00090"></a>00090 <span class="preprocessor"></span><span class="preprocessor">#define SMS_DCS_8BIT 0x01</span>
<a name="l00091"></a>00091 <span class="preprocessor"></span><span class="preprocessor">#define SMS_DCS_UCS2 0x02</span>
<a name="l00092"></a>00092 <span class="preprocessor"></span>
<a name="l00093"></a>00093 } __attribute__ ((packed));
<a name="l00094"></a>00094 <span class="preprocessor">#define SMS_METADATA_SIZE       (sizeof(::Barry::Protocol::SMSMetaData))</span>
<a name="l00095"></a>00095 <span class="preprocessor"></span>
<a name="l00096"></a>00096 
<a name="l00097"></a>00097 <span class="comment"></span>
<a name="l00098"></a>00098 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00099"></a>00099 <span class="comment"></span><span class="comment">// Record Field Formats</span>
<a name="l00100"></a>00100 
<a name="l00101"></a><a class="code" href="structBarry_1_1Protocol_1_1CommonField.html">00101</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1CommonField.html">CommonField</a>
<a name="l00102"></a>00102 {
<a name="l00103"></a>00103         uint16_t        size;                   <span class="comment">// including null terminator</span>
<a name="l00104"></a>00104         uint8_t         type;
<a name="l00105"></a>00105 
<a name="l00106"></a><a class="code" href="unionBarry_1_1Protocol_1_1CommonField_1_1CommonFieldData.html">00106</a>         <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1CommonField_1_1CommonFieldData.html">CommonFieldData</a>
<a name="l00107"></a>00107         {
<a name="l00108"></a>00108 
<a name="l00109"></a>00109                 <a class="code" href="structBarry_1_1Protocol_1_1GroupLink.html">GroupLink</a>       link;
<a name="l00110"></a>00110                 <a class="code" href="structBarry_1_1Protocol_1_1MessageAddress.html">MessageAddress</a>  addr;
<a name="l00111"></a>00111                 <a class="code" href="structBarry_1_1Protocol_1_1SMSMetaData.html">SMSMetaData</a>     sms_metadata;
<a name="l00112"></a>00112                 uint64_t        timestamp;
<a name="l00113"></a>00113                 uint64_t        uint64;
<a name="l00114"></a>00114                 uint32_t        uint32;
<a name="l00115"></a>00115                 int32_t         min1900;
<a name="l00116"></a>00116                 uint16_t        code;
<a name="l00117"></a>00117                 uint8_t         raw[1];
<a name="l00118"></a>00118                 int16_t         int16;
<a name="l00119"></a>00119 
<a name="l00120"></a>00120         } __attribute__ ((packed)) u;
<a name="l00121"></a>00121 
<a name="l00122"></a>00122 } __attribute__ ((packed));
<a name="l00123"></a>00123 <span class="preprocessor">#define COMMON_FIELD_HEADER_SIZE        (sizeof(::Barry::Protocol::CommonField) - sizeof(::Barry::Protocol::CommonField::CommonFieldData))</span>
<a name="l00124"></a>00124 <span class="preprocessor"></span><span class="preprocessor">#define COMMON_FIELD_MIN1900_SIZE       (sizeof(int32_t))</span>
<a name="l00125"></a>00125 <span class="preprocessor"></span>
<a name="l00126"></a><a class="code" href="structBarry_1_1Protocol_1_1CommandTableField.html">00126</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1CommandTableField.html">CommandTableField</a>
<a name="l00127"></a>00127 {
<a name="l00128"></a>00128         uint8_t         size;           <span class="comment">// no null terminator</span>
<a name="l00129"></a>00129         uint8_t         code;
<a name="l00130"></a>00130         uint8_t         name[1];
<a name="l00131"></a>00131 } __attribute__ ((packed));
<a name="l00132"></a>00132 <span class="preprocessor">#define COMMAND_FIELD_HEADER_SIZE       (sizeof(::Barry::Protocol::CommandTableField) - 1)</span>
<a name="l00133"></a>00133 <span class="preprocessor"></span>
<a name="l00134"></a><a class="code" href="structBarry_1_1Protocol_1_1OldDBDBField.html">00134</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1OldDBDBField.html">OldDBDBField</a>
<a name="l00135"></a>00135 {
<a name="l00136"></a>00136         uint16_t        dbNumber;
<a name="l00137"></a>00137         uint8_t         unknown1;
<a name="l00138"></a>00138         uint32_t        dbSize;                 <span class="comment">// assumed from Cassis docs...</span>
<a name="l00139"></a>00139                                                 <span class="comment">// always 0 in USB</span>
<a name="l00140"></a>00140         uint16_t        dbRecordCount;
<a name="l00141"></a>00141         uint16_t        unknown2;
<a name="l00142"></a>00142         uint16_t        nameSize;               <span class="comment">// includes null terminator</span>
<a name="l00143"></a>00143         uint8_t         name[1];
<a name="l00144"></a>00144 } __attribute__ ((packed));
<a name="l00145"></a>00145 <span class="preprocessor">#define OLD_DBDB_FIELD_HEADER_SIZE      (sizeof(::Barry::Protocol::OldDBDBField) - 1)</span>
<a name="l00146"></a>00146 <span class="preprocessor"></span>
<a name="l00147"></a><a class="code" href="structBarry_1_1Protocol_1_1DBDBField.html">00147</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1DBDBField.html">DBDBField</a>
<a name="l00148"></a>00148 {
<a name="l00149"></a>00149         uint16_t        dbNumber;
<a name="l00150"></a>00150         uint8_t         unknown1;
<a name="l00151"></a>00151         uint32_t        dbSize;                 <span class="comment">// assumed from Cassis docs...</span>
<a name="l00152"></a>00152                                                 <span class="comment">// always 0 in USB</span>
<a name="l00153"></a>00153         uint32_t        dbRecordCount;
<a name="l00154"></a>00154         uint16_t        unknown2;
<a name="l00155"></a>00155         uint16_t        nameSize;               <span class="comment">// includes null terminator</span>
<a name="l00156"></a>00156         uint8_t         unknown3;
<a name="l00157"></a>00157         uint8_t         name[1];                <span class="comment">// followed by 2 zeros!</span>
<a name="l00158"></a>00158         uint16_t        unknown;                <span class="comment">// this comes after the</span>
<a name="l00159"></a>00159                                                 <span class="comment">// null terminated name, but</span>
<a name="l00160"></a>00160                                                 <span class="comment">// is here for size calcs</span>
<a name="l00161"></a>00161 } __attribute__ ((packed));
<a name="l00162"></a>00162 <span class="preprocessor">#define DBDB_FIELD_HEADER_SIZE  (sizeof(::Barry::Protocol::DBDBField) - 1)</span>
<a name="l00163"></a>00163 <span class="preprocessor"></span>
<a name="l00164"></a><a class="code" href="structBarry_1_1Protocol_1_1RecordStateTableField.html">00164</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1RecordStateTableField.html">RecordStateTableField</a>
<a name="l00165"></a>00165 {
<a name="l00166"></a>00166         uint8_t         rectype;                <span class="comment">// it is unknown exactly what</span>
<a name="l00167"></a>00167                                                 <span class="comment">// this field does, but it</span>
<a name="l00168"></a>00168                                                 <span class="comment">// shows up here and in the</span>
<a name="l00169"></a>00169                                                 <span class="comment">// tagged record header, and</span>
<a name="l00170"></a>00170                                                 <span class="comment">// for some of the records</span>
<a name="l00171"></a>00171                                                 <span class="comment">// they must match when writing</span>
<a name="l00172"></a>00172         uint16_t        index;
<a name="l00173"></a>00173         uint32_t        uniqueId;               <span class="comment">// matches the uniqueId of say,</span>
<a name="l00174"></a>00174                                                 <span class="comment">// address book records</span>
<a name="l00175"></a>00175         uint8_t         flags;                  <span class="comment">// bit 0x01 is the dirty flag</span>
<a name="l00176"></a>00176                                                 <span class="comment">// don&#39;t know if any other bits</span>
<a name="l00177"></a>00177                                                 <span class="comment">// are used</span>
<a name="l00178"></a>00178 <span class="preprocessor">#define BARRY_RSTF_DIRTY        0x01</span>
<a name="l00179"></a>00179 <span class="preprocessor"></span>        uint8_t         unknown2[4];
<a name="l00180"></a>00180 } __attribute__ ((packed));
<a name="l00181"></a>00181 
<a name="l00182"></a><a class="code" href="structBarry_1_1Protocol_1_1CalendarRecurrenceDataField.html">00182</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1CalendarRecurrenceDataField.html">CalendarRecurrenceDataField</a>  <span class="comment">// as documented in the Cassis project spec</span>
<a name="l00183"></a>00183 {
<a name="l00184"></a>00184         uint8_t         type;
<a name="l00185"></a>00185 <span class="preprocessor">#define CRDF_TYPE_DAY           0x01</span>
<a name="l00186"></a>00186 <span class="preprocessor"></span><span class="preprocessor">#define CRDF_TYPE_MONTH_BY_DATE 0x03</span>
<a name="l00187"></a>00187 <span class="preprocessor"></span><span class="preprocessor">#define CRDF_TYPE_MONTH_BY_DAY  0x04</span>
<a name="l00188"></a>00188 <span class="preprocessor"></span><span class="preprocessor">#define CRDF_TYPE_YEAR_BY_DATE  0x05</span>
<a name="l00189"></a>00189 <span class="preprocessor"></span><span class="preprocessor">#define CRDF_TYPE_YEAR_BY_DAY   0x06</span>
<a name="l00190"></a>00190 <span class="preprocessor"></span><span class="preprocessor">#define CRDF_TYPE_WEEK          0x0c</span>
<a name="l00191"></a>00191 <span class="preprocessor"></span>
<a name="l00192"></a>00192         uint8_t         unknown;                <span class="comment">// always 0x01</span>
<a name="l00193"></a>00193         uint16_t        interval;
<a name="l00194"></a>00194         uint32_t        startTime;
<a name="l00195"></a>00195         uint32_t        endTime;                <span class="comment">// 0xFFFFFFFF for never</span>
<a name="l00196"></a>00196 
<a name="l00197"></a><a class="code" href="unionBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional.html">00197</a>         <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional.html">Additional</a>
<a name="l00198"></a>00198         {
<a name="l00199"></a>00199                 <span class="comment">// Note: blank fields should be set to 0</span>
<a name="l00200"></a>00200 
<a name="l00201"></a><a class="code" href="structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Day.html">00201</a>                 <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Day.html">Day</a>
<a name="l00202"></a>00202                 {
<a name="l00203"></a>00203                         uint8_t day[6];         <span class="comment">// always zeros!</span>
<a name="l00204"></a>00204                 } __attribute__ ((packed)) day;
<a name="l00205"></a>00205 
<a name="l00206"></a><a class="code" href="structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDate.html">00206</a>                 struct <a class="code" href="structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDate.html">MonthByDate</a>
<a name="l00207"></a>00207                 {
<a name="l00208"></a>00208                         uint8_t monthDay;       <span class="comment">// day of month to recur on</span>
<a name="l00209"></a>00209                                                 <span class="comment">// (1-31)</span>
<a name="l00210"></a>00210                         uint8_t blank[5];
<a name="l00211"></a>00211                 } __attribute__ ((packed)) month_by_date;
<a name="l00212"></a>00212 
<a name="l00213"></a><a class="code" href="structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDay.html">00213</a>                 struct <a class="code" href="structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1MonthByDay.html">MonthByDay</a>
<a name="l00214"></a>00214                 {
<a name="l00215"></a>00215                         uint8_t weekDay;        <span class="comment">// day of week to recur on (0-6)</span>
<a name="l00216"></a>00216                         uint8_t week;           <span class="comment">// week of month to recur on</span>
<a name="l00217"></a>00217                                                 <span class="comment">// (1 to 5, first week, second</span>
<a name="l00218"></a>00218                                                 <span class="comment">// week, etc)</span>
<a name="l00219"></a>00219                         uint8_t blank[4];
<a name="l00220"></a>00220                 } __attribute__ ((packed)) month_by_day;
<a name="l00221"></a>00221 
<a name="l00222"></a><a class="code" href="structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDate.html">00222</a>                 struct <a class="code" href="structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDate.html">YearByDate</a>
<a name="l00223"></a>00223                 {
<a name="l00224"></a>00224                         uint8_t monthDay;       <span class="comment">// day of month to recur on</span>
<a name="l00225"></a>00225                                                 <span class="comment">// (1-31)</span>
<a name="l00226"></a>00226                         uint8_t blank;
<a name="l00227"></a>00227                         uint8_t month;          <span class="comment">// month to recur on (1-12)</span>
<a name="l00228"></a>00228                         uint8_t blank_[3];
<a name="l00229"></a>00229                 } __attribute__ ((packed)) year_by_date;
<a name="l00230"></a>00230 
<a name="l00231"></a><a class="code" href="structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDay.html">00231</a>                 struct <a class="code" href="structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1YearByDay.html">YearByDay</a>
<a name="l00232"></a>00232                 {
<a name="l00233"></a>00233                         uint8_t weekDay;        <span class="comment">// day of week to recur on (0-6)</span>
<a name="l00234"></a>00234                         uint8_t week;           <span class="comment">// week of month (1 to 5)</span>
<a name="l00235"></a>00235                         uint8_t month;          <span class="comment">// (1-12)</span>
<a name="l00236"></a>00236                         uint8_t blank[3];
<a name="l00237"></a>00237                 } __attribute__ ((packed)) year_by_day;
<a name="l00238"></a>00238 
<a name="l00239"></a><a class="code" href="structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Week.html">00239</a>                 struct <a class="code" href="structBarry_1_1Protocol_1_1CalendarRecurrenceDataField_1_1Additional_1_1Week.html">Week</a>
<a name="l00240"></a>00240                 {
<a name="l00241"></a>00241                         uint8_t days;           <span class="comment">// bitmask</span>
<a name="l00242"></a>00242 <span class="preprocessor">                        #define CRDF_WD_SUN     0x01</span>
<a name="l00243"></a>00243 <span class="preprocessor"></span><span class="preprocessor">                        #define CRDF_WD_MON     0x02</span>
<a name="l00244"></a>00244 <span class="preprocessor"></span><span class="preprocessor">                        #define CRDF_WD_TUE     0x04</span>
<a name="l00245"></a>00245 <span class="preprocessor"></span><span class="preprocessor">                        #define CRDF_WD_WED     0x08</span>
<a name="l00246"></a>00246 <span class="preprocessor"></span><span class="preprocessor">                        #define CRDF_WD_THU     0x10</span>
<a name="l00247"></a>00247 <span class="preprocessor"></span><span class="preprocessor">                        #define CRDF_WD_FRI     0x20</span>
<a name="l00248"></a>00248 <span class="preprocessor"></span><span class="preprocessor">                        #define CRDF_WD_SAT     0x40</span>
<a name="l00249"></a>00249 <span class="preprocessor"></span>
<a name="l00250"></a>00250                         uint8_t blank[5];
<a name="l00251"></a>00251                 } __attribute__ ((packed)) week;
<a name="l00252"></a>00252 
<a name="l00253"></a>00253         } __attribute__ ((packed)) u;
<a name="l00254"></a>00254 
<a name="l00255"></a>00255 } __attribute__ ((packed));
<a name="l00256"></a>00256 <span class="preprocessor">#define CALENDAR_RECURRENCE_DATA_FIELD_SIZE     sizeof(::Barry::Protocol::CalendarRecurrenceDataField)</span>
<a name="l00257"></a>00257 <span class="preprocessor"></span>
<a name="l00258"></a>00258 <span class="comment">//</span>
<a name="l00259"></a>00259 <span class="comment">// Calendar record: field constants</span>
<a name="l00260"></a>00260 <span class="comment">//</span>
<a name="l00261"></a>00261 
<a name="l00262"></a>00262 <span class="preprocessor">#define CR_FREEBUSY_FREE                0</span>
<a name="l00263"></a>00263 <span class="preprocessor"></span><span class="preprocessor">#define CR_FREEBUSY_TENTATIVE           1</span>
<a name="l00264"></a>00264 <span class="preprocessor"></span><span class="preprocessor">#define CR_FREEBUSY_BUSY                2</span>
<a name="l00265"></a>00265 <span class="preprocessor"></span><span class="preprocessor">#define CR_FREEBUSY_OUT_OF_OFFICE       3</span>
<a name="l00266"></a>00266 <span class="preprocessor"></span><span class="preprocessor">#define CR_FREEBUSY_RANGE_LOW           0</span>
<a name="l00267"></a>00267 <span class="preprocessor"></span><span class="preprocessor">#define CR_FREEBUSY_RANGE_HIGH          3</span>
<a name="l00268"></a>00268 <span class="preprocessor"></span>
<a name="l00269"></a>00269 <span class="preprocessor">#define CR_CLASS_PUBLIC                 0</span>
<a name="l00270"></a>00270 <span class="preprocessor"></span><span class="preprocessor">#define CR_CLASS_CONFIDENTIAL           1</span>
<a name="l00271"></a>00271 <span class="preprocessor"></span><span class="preprocessor">#define CR_CLASS_PRIVATE                2</span>
<a name="l00272"></a>00272 <span class="preprocessor"></span><span class="preprocessor">#define CR_CLASS_RANGE_LOW              0</span>
<a name="l00273"></a>00273 <span class="preprocessor"></span><span class="preprocessor">#define CR_CLASS_RANGE_HIGH             2</span>
<a name="l00274"></a>00274 <span class="preprocessor"></span>
<a name="l00275"></a>00275 
<a name="l00276"></a>00276 <span class="comment">//</span>
<a name="l00277"></a>00277 <span class="comment">// Task record: field constants</span>
<a name="l00278"></a>00278 <span class="comment">//</span>
<a name="l00279"></a>00279 
<a name="l00280"></a>00280 <span class="preprocessor">#define TR_ALARM_DATE                   1</span>
<a name="l00281"></a>00281 <span class="preprocessor"></span><span class="preprocessor">#define TR_ALARM_RELATIVE               2</span>
<a name="l00282"></a>00282 <span class="preprocessor"></span><span class="preprocessor">#define TR_ALARM_RANGE_LOW              1</span>
<a name="l00283"></a>00283 <span class="preprocessor"></span><span class="preprocessor">#define TR_ALARM_RANGE_HIGH             2</span>
<a name="l00284"></a>00284 <span class="preprocessor"></span>
<a name="l00285"></a>00285 <span class="preprocessor">#define TR_PRIORITY_HIGH                0</span>
<a name="l00286"></a>00286 <span class="preprocessor"></span><span class="preprocessor">#define TR_PRIORITY_NORMAL              1</span>
<a name="l00287"></a>00287 <span class="preprocessor"></span><span class="preprocessor">#define TR_PRIORITY_LOW                 2</span>
<a name="l00288"></a>00288 <span class="preprocessor"></span><span class="preprocessor">#define TR_PRIORITY_RANGE_LOW           0</span>
<a name="l00289"></a>00289 <span class="preprocessor"></span><span class="preprocessor">#define TR_PRIORITY_RANGE_HIGH          2</span>
<a name="l00290"></a>00290 <span class="preprocessor"></span>
<a name="l00291"></a>00291 <span class="preprocessor">#define TR_STATUS_NOT_STARTED           0</span>
<a name="l00292"></a>00292 <span class="preprocessor"></span><span class="preprocessor">#define TR_STATUS_IN_PROGRESS           1</span>
<a name="l00293"></a>00293 <span class="preprocessor"></span><span class="preprocessor">#define TR_STATUS_COMPLETED             2</span>
<a name="l00294"></a>00294 <span class="preprocessor"></span><span class="preprocessor">#define TR_STATUS_WAITING               3</span>
<a name="l00295"></a>00295 <span class="preprocessor"></span><span class="preprocessor">#define TR_STATUS_DEFERRED              4</span>
<a name="l00296"></a>00296 <span class="preprocessor"></span><span class="preprocessor">#define TR_STATUS_RANGE_LOW             0</span>
<a name="l00297"></a>00297 <span class="preprocessor"></span><span class="preprocessor">#define TR_STATUS_RANGE_HIGH            4</span>
<a name="l00298"></a>00298 <span class="preprocessor"></span>
<a name="l00299"></a>00299 <span class="comment">//</span>
<a name="l00300"></a>00300 <span class="comment">// Phone Call Logs record: field constants</span>
<a name="l00301"></a>00301 <span class="comment">//</span>
<a name="l00302"></a>00302 <span class="comment">//</span>
<a name="l00303"></a>00303 <span class="preprocessor">#define CLL_DIRECTION_RECEIVER          0</span>
<a name="l00304"></a>00304 <span class="preprocessor"></span><span class="preprocessor">#define CLL_DIRECTION_EMITTER           1</span>
<a name="l00305"></a>00305 <span class="preprocessor"></span><span class="preprocessor">#define CLL_DIRECTION_FAILED            2</span>
<a name="l00306"></a>00306 <span class="preprocessor"></span><span class="preprocessor">#define CLL_DIRECTION_MISSING           3</span>
<a name="l00307"></a>00307 <span class="preprocessor"></span><span class="preprocessor">#define CLL_DIRECTION_RANGE_LOW         0</span>
<a name="l00308"></a>00308 <span class="preprocessor"></span><span class="preprocessor">#define CLL_DIRECTION_RANGE_HIGH        3</span>
<a name="l00309"></a>00309 <span class="preprocessor"></span>
<a name="l00310"></a>00310 <span class="preprocessor">#define CLL_PHONETYPE_UNDEFINED         0</span>
<a name="l00311"></a>00311 <span class="preprocessor"></span><span class="preprocessor">#define CLL_PHONETYPE_OFFICE            1</span>
<a name="l00312"></a>00312 <span class="preprocessor"></span><span class="preprocessor">#define CLL_PHONETYPE_HOME                      2</span>
<a name="l00313"></a>00313 <span class="preprocessor"></span><span class="preprocessor">#define CLL_PHONETYPE_MOBILE            3</span>
<a name="l00314"></a>00314 <span class="preprocessor"></span><span class="preprocessor">#define CLL_PHONETYPE_RANGE_LOW         0</span>
<a name="l00315"></a>00315 <span class="preprocessor"></span><span class="preprocessor">#define CLL_PHONETYPE_RANGE_HIGH        3</span>
<a name="l00316"></a>00316 <span class="preprocessor"></span>
<a name="l00317"></a>00317 <span class="comment">//</span>
<a name="l00318"></a>00318 <span class="comment">// Folder record: field constants</span>
<a name="l00319"></a>00319 <span class="comment">//</span>
<a name="l00320"></a>00320 
<a name="l00321"></a>00321 <span class="preprocessor">#define FR_TYPE_SUBTREE                 0x00</span>
<a name="l00322"></a>00322 <span class="preprocessor"></span><span class="preprocessor">#define FR_TYPE_DELETED                 0x01</span>
<a name="l00323"></a>00323 <span class="preprocessor"></span><span class="preprocessor">#define FR_TYPE_INBOX                   0x02</span>
<a name="l00324"></a>00324 <span class="preprocessor"></span><span class="preprocessor">#define FR_TYPE_OUTBOX                  0x03</span>
<a name="l00325"></a>00325 <span class="preprocessor"></span><span class="preprocessor">#define FR_TYPE_SENT                    0x04</span>
<a name="l00326"></a>00326 <span class="preprocessor"></span><span class="preprocessor">#define FR_TYPE_OTHER                   0x05</span>
<a name="l00327"></a>00327 <span class="preprocessor"></span><span class="preprocessor">#define FR_TYPE_DRAFT                   0x0a</span>
<a name="l00328"></a>00328 <span class="preprocessor"></span>
<a name="l00329"></a>00329 <span class="preprocessor">#define FR_STATUS_ORPHAN                0x50</span>
<a name="l00330"></a>00330 <span class="preprocessor"></span><span class="preprocessor">#define FR_STATUS_UNFILED               0x51</span>
<a name="l00331"></a>00331 <span class="preprocessor"></span><span class="preprocessor">#define FR_STATUS_FILED                 0x52</span>
<a name="l00332"></a>00332 <span class="preprocessor"></span>
<a name="l00333"></a>00333 <span class="comment"></span>
<a name="l00334"></a>00334 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00335"></a>00335 <span class="comment"></span><span class="comment">// Packed field structures - odd format used with Service Book records</span>
<a name="l00336"></a>00336 
<a name="l00337"></a><a class="code" href="structBarry_1_1Protocol_1_1PackedField__02.html">00337</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1PackedField__02.html">PackedField_02</a>
<a name="l00338"></a>00338 {
<a name="l00339"></a>00339         uint8_t         code;
<a name="l00340"></a>00340         uint8_t         size;
<a name="l00341"></a>00341         uint8_t         type;
<a name="l00342"></a>00342         uint8_t         raw[1];
<a name="l00343"></a>00343 } __attribute__ ((packed));
<a name="l00344"></a>00344 <span class="preprocessor">#define PACKED_FIELD_02_HEADER_SIZE     (sizeof(::Barry::Protocol::PackedField_02) - 1)</span>
<a name="l00345"></a>00345 <span class="preprocessor"></span>
<a name="l00346"></a><a class="code" href="structBarry_1_1Protocol_1_1PackedField__10.html">00346</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1PackedField__10.html">PackedField_10</a>
<a name="l00347"></a>00347 {
<a name="l00348"></a>00348         uint8_t         type;
<a name="l00349"></a>00349         uint8_t         size;
<a name="l00350"></a>00350         uint8_t         raw[1];
<a name="l00351"></a>00351 } __attribute__ ((packed));
<a name="l00352"></a>00352 <span class="preprocessor">#define PACKED_FIELD_10_HEADER_SIZE     (sizeof(::Barry::Protocol::PackedField_10) - 1)</span>
<a name="l00353"></a>00353 <span class="preprocessor"></span>
<a name="l00354"></a>00354 
<a name="l00355"></a>00355 
<a name="l00356"></a>00356 <span class="comment"></span>
<a name="l00357"></a>00357 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00358"></a>00358 <span class="comment"></span><span class="comment">// Service Book field and record structures</span>
<a name="l00359"></a>00359 
<a name="l00360"></a><a class="code" href="structBarry_1_1Protocol_1_1ServiceBookConfigField.html">00360</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1ServiceBookConfigField.html">ServiceBookConfigField</a>
<a name="l00361"></a>00361 {
<a name="l00362"></a>00362         uint8_t         format;
<a name="l00363"></a>00363         uint8_t         fields[1];
<a name="l00364"></a>00364 } __attribute__ ((packed));
<a name="l00365"></a>00365 <span class="preprocessor">#define SERVICE_BOOK_CONFIG_FIELD_HEADER_SIZE (sizeof(::Barry::Protocol::ServiceBookConfigField) - 1)</span>
<a name="l00366"></a>00366 <span class="preprocessor"></span>
<a name="l00367"></a>00367 <span class="comment"></span>
<a name="l00368"></a>00368 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00369"></a>00369 <span class="comment"></span><span class="comment">// DB Command Parameter structures</span>
<a name="l00370"></a>00370 
<a name="l00371"></a><a class="code" href="structBarry_1_1Protocol_1_1DBC__Record.html">00371</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1DBC__Record.html">DBC_Record</a>
<a name="l00372"></a>00372 {
<a name="l00373"></a>00373         uint16_t        recordIndex;    <span class="comment">// index comes from RecordStateTable</span>
<a name="l00374"></a>00374         uint8_t         data[1];
<a name="l00375"></a>00375 } __attribute__ ((packed));
<a name="l00376"></a>00376 <span class="preprocessor">#define DBC_RECORD_HEADER_SIZE          (sizeof(::Barry::Protocol::DBC_Record) - 1)</span>
<a name="l00377"></a>00377 <span class="preprocessor"></span>
<a name="l00378"></a><a class="code" href="structBarry_1_1Protocol_1_1DBC__RecordFlags.html">00378</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1DBC__RecordFlags.html">DBC_RecordFlags</a>
<a name="l00379"></a>00379 {
<a name="l00380"></a>00380         uint8_t         unknown;
<a name="l00381"></a>00381         uint16_t        index;
<a name="l00382"></a>00382         uint8_t         unknown2[5];
<a name="l00383"></a>00383 } __attribute__ ((packed));
<a name="l00384"></a>00384 <span class="preprocessor">#define DBC_RECORD_FLAGS_SIZE           (sizeof(::Barry::Protocol::DBC_RecordFlags))</span>
<a name="l00385"></a>00385 <span class="preprocessor"></span>
<a name="l00386"></a><a class="code" href="structBarry_1_1Protocol_1_1DBC__TaggedUpload.html">00386</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1DBC__TaggedUpload.html">DBC_TaggedUpload</a>
<a name="l00387"></a>00387 {
<a name="l00388"></a>00388         uint8_t         rectype;                <span class="comment">// it is unknown exactly what</span>
<a name="l00389"></a>00389                                                 <span class="comment">// this field does, but it</span>
<a name="l00390"></a>00390                                                 <span class="comment">// shows up here and in the</span>
<a name="l00391"></a>00391                                                 <span class="comment">// RecordStateTable, and</span>
<a name="l00392"></a>00392                                                 <span class="comment">// for some of the records</span>
<a name="l00393"></a>00393                                                 <span class="comment">// they must match when writing</span>
<a name="l00394"></a>00394         uint32_t        uniqueId;
<a name="l00395"></a>00395         uint8_t         unknown2;
<a name="l00396"></a>00396         uint8_t         data[1];
<a name="l00397"></a>00397 } __attribute__ ((packed));
<a name="l00398"></a>00398 <span class="preprocessor">#define DBC_TAGGED_UPLOAD_HEADER_SIZE   (sizeof(::Barry::Protocol::DBC_TaggedUpload) - 1)</span>
<a name="l00399"></a>00399 <span class="preprocessor"></span>
<a name="l00400"></a><a class="code" href="structBarry_1_1Protocol_1_1DBC__IndexedUpload.html">00400</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1DBC__IndexedUpload.html">DBC_IndexedUpload</a>
<a name="l00401"></a>00401 {
<a name="l00402"></a>00402         uint8_t         unknown;        <span class="comment">// observed: 00 or 05</span>
<a name="l00403"></a>00403         uint16_t        index;
<a name="l00404"></a>00404         uint8_t         data[1];
<a name="l00405"></a>00405 } __attribute__ ((packed));
<a name="l00406"></a>00406 <span class="preprocessor">#define DBC_INDEXED_UPLOAD_HEADER_SIZE  (sizeof(::Barry::Protocol::DBC_IndexedUpload) - 1)</span>
<a name="l00407"></a>00407 <span class="preprocessor"></span>
<a name="l00408"></a><a class="code" href="structBarry_1_1Protocol_1_1PasswordChallenge.html">00408</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1PasswordChallenge.html">PasswordChallenge</a>
<a name="l00409"></a>00409 {
<a name="l00410"></a>00410         uint8_t         remaining_tries;        <span class="comment">// number of password attempts</span>
<a name="l00411"></a>00411                                                 <span class="comment">// the device will accept before</span>
<a name="l00412"></a>00412                                                 <span class="comment">// committing suicide...</span>
<a name="l00413"></a>00413                                                 <span class="comment">// starts at 10 and counts down</span>
<a name="l00414"></a>00414                                                 <span class="comment">// on each bad password</span>
<a name="l00415"></a>00415         uint8_t         unknown;                <span class="comment">// observed as 0... probably just</span>
<a name="l00416"></a>00416                                                 <span class="comment">// the top byte of a uint16</span>
<a name="l00417"></a>00417                                                 <span class="comment">// remaining_tries, but I don&#39;t</span>
<a name="l00418"></a>00418                                                 <span class="comment">// want to take that chance</span>
<a name="l00419"></a>00419         uint16_t        param;                  <span class="comment">// seems to be a secondary command</span>
<a name="l00420"></a>00420                                                 <span class="comment">// of some kind, observed as 0x14</span>
<a name="l00421"></a>00421                                                 <span class="comment">// or 0x04, but purpose unknown</span>
<a name="l00422"></a>00422                                                 <span class="comment">// possibly a send/receive flag</span>
<a name="l00423"></a>00423                                                 <span class="comment">// bit (0x10/0x00)</span>
<a name="l00424"></a><a class="code" href="unionBarry_1_1Protocol_1_1PasswordChallenge_1_1Hash.html">00424</a>         <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1PasswordChallenge_1_1Hash.html">Hash</a>
<a name="l00425"></a>00425         {
<a name="l00426"></a>00426                 uint32_t        seed;
<a name="l00427"></a>00427                 uint8_t         hash[20];
<a name="l00428"></a>00428         } __attribute__ ((packed)) u;
<a name="l00429"></a>00429 
<a name="l00430"></a>00430 } __attribute__ ((packed));
<a name="l00431"></a>00431 <span class="preprocessor">#define PASSWORD_CHALLENGE_HEADER_SIZE  (sizeof(::Barry::Protocol::PasswordChallenge) - sizeof(::Barry::Protocol::PasswordChallenge::Hash))</span>
<a name="l00432"></a>00432 <span class="preprocessor"></span><span class="preprocessor">#define PASSWORD_CHALLENGE_SEED_SIZE    (PASSWORD_CHALLENGE_HEADER_SIZE + sizeof(uint32_t))</span>
<a name="l00433"></a>00433 <span class="preprocessor"></span><span class="preprocessor">#define PASSWORD_CHALLENGE_SIZE         (sizeof(::Barry::Protocol::PasswordChallenge))</span>
<a name="l00434"></a>00434 <span class="preprocessor"></span>
<a name="l00435"></a><a class="code" href="structBarry_1_1Protocol_1_1AttributeFetch.html">00435</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1AttributeFetch.html">AttributeFetch</a>
<a name="l00436"></a>00436 {
<a name="l00437"></a>00437         uint16_t        object;
<a name="l00438"></a>00438         uint16_t        attribute;
<a name="l00439"></a>00439         uint8_t         raw[1];                 <span class="comment">// used only in response</span>
<a name="l00440"></a>00440 } __attribute__ ((packed));
<a name="l00441"></a>00441 <span class="preprocessor">#define ATTRIBUTE_FETCH_COMMAND_SIZE    (sizeof(::Barry::Protocol::AttributeFetch) - 1)</span>
<a name="l00442"></a>00442 <span class="preprocessor"></span>
<a name="l00443"></a><a class="code" href="structBarry_1_1Protocol_1_1ModeSelect.html">00443</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1ModeSelect.html">ModeSelect</a>
<a name="l00444"></a>00444 {
<a name="l00445"></a>00445         uint8_t         name[16];
<a name="l00446"></a><a class="code" href="structBarry_1_1Protocol_1_1ModeSelect_1_1ResponseBlock.html">00446</a>         <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1ModeSelect_1_1ResponseBlock.html">ResponseBlock</a>
<a name="l00447"></a>00447         {
<a name="l00448"></a>00448                 uint8_t         unknown[20];
<a name="l00449"></a>00449         } __attribute__ ((packed)) response;
<a name="l00450"></a>00450 } __attribute__ ((packed));
<a name="l00451"></a>00451 
<a name="l00452"></a><a class="code" href="structBarry_1_1Protocol_1_1Echo.html">00452</a> struct <a class="code" href="structBarry_1_1Protocol_1_1Echo.html">Echo</a>
<a name="l00453"></a>00453 {
<a name="l00454"></a>00454         uint64_t        ticks;                  <span class="comment">// number of microseconds since</span>
<a name="l00455"></a>00455                                                 <span class="comment">// host system startup</span>
<a name="l00456"></a>00456 } __attribute__ ((packed));
<a name="l00457"></a>00457 <span class="preprocessor">#define ECHO_COMMAND_SIZE               (sizeof(::Barry::Protocol::Echo))</span>
<a name="l00458"></a>00458 <span class="preprocessor"></span>
<a name="l00459"></a>00459 <span class="comment"></span>
<a name="l00460"></a>00460 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00461"></a>00461 <span class="comment"></span><span class="comment">// Protocol command structures</span>
<a name="l00462"></a>00462 
<a name="l00463"></a><a class="code" href="structBarry_1_1Protocol_1_1SocketCommand.html">00463</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1SocketCommand.html">SocketCommand</a>
<a name="l00464"></a>00464 {
<a name="l00465"></a>00465         uint16_t        socket;
<a name="l00466"></a>00466         uint8_t         sequence;               <span class="comment">// incremented on each socket 0</span>
<a name="l00467"></a>00467                                                 <span class="comment">// communication, replies return</span>
<a name="l00468"></a>00468                                                 <span class="comment">// the same number from command</span>
<a name="l00469"></a>00469 
<a name="l00470"></a><a class="code" href="unionBarry_1_1Protocol_1_1SocketCommand_1_1PacketData.html">00470</a>         <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1SocketCommand_1_1PacketData.html">PacketData</a>
<a name="l00471"></a>00471         {
<a name="l00472"></a>00472 
<a name="l00473"></a>00473                 <a class="code" href="structBarry_1_1Protocol_1_1PasswordChallenge.html">PasswordChallenge</a>       password;
<a name="l00474"></a>00474                 <a class="code" href="structBarry_1_1Protocol_1_1AttributeFetch.html">AttributeFetch</a>          fetch;
<a name="l00475"></a>00475                 <a class="code" href="structBarry_1_1Protocol_1_1ModeSelect.html">ModeSelect</a>              mode;
<a name="l00476"></a>00476                 uint8_t                 raw[1];
<a name="l00477"></a>00477                 <a class="code" href="structBarry_1_1Protocol_1_1Echo.html">Echo</a>                    echo;
<a name="l00478"></a>00478 
<a name="l00479"></a>00479         } __attribute__ ((packed)) u;
<a name="l00480"></a>00480 } __attribute__ ((packed));
<a name="l00481"></a>00481 <span class="preprocessor">#define SOCKET_COMMAND_HEADER_SIZE              (sizeof(::Barry::Protocol::SocketCommand) - sizeof(::Barry::Protocol::SocketCommand::PacketData))</span>
<a name="l00482"></a>00482 <span class="preprocessor"></span>
<a name="l00483"></a><a class="code" href="structBarry_1_1Protocol_1_1SequenceCommand.html">00483</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1SequenceCommand.html">SequenceCommand</a>
<a name="l00484"></a>00484 {
<a name="l00485"></a>00485         uint8_t         unknown1;
<a name="l00486"></a>00486         uint8_t         unknown2;
<a name="l00487"></a>00487         uint8_t         unknown3;
<a name="l00488"></a>00488         uint32_t        sequenceId;
<a name="l00489"></a>00489 } __attribute__ ((packed));
<a name="l00490"></a>00490 
<a name="l00491"></a><a class="code" href="structBarry_1_1Protocol_1_1DBCommand.html">00491</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1DBCommand.html">DBCommand</a>
<a name="l00492"></a>00492 {
<a name="l00493"></a>00493         uint8_t         operation;      <span class="comment">// see below</span>
<a name="l00494"></a>00494         uint16_t        databaseId;     <span class="comment">// value from the Database Database</span>
<a name="l00495"></a>00495 
<a name="l00496"></a><a class="code" href="unionBarry_1_1Protocol_1_1DBCommand_1_1Parameters.html">00496</a>         <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1DBCommand_1_1Parameters.html">Parameters</a>
<a name="l00497"></a>00497         {
<a name="l00498"></a>00498 
<a name="l00499"></a>00499                 <a class="code" href="structBarry_1_1Protocol_1_1DBC__Record.html">DBC_Record</a>              record;
<a name="l00500"></a>00500                 <a class="code" href="structBarry_1_1Protocol_1_1DBC__RecordFlags.html">DBC_RecordFlags</a>         flags;
<a name="l00501"></a>00501                 <a class="code" href="structBarry_1_1Protocol_1_1DBC__TaggedUpload.html">DBC_TaggedUpload</a>        tag_upload;
<a name="l00502"></a>00502                 <a class="code" href="structBarry_1_1Protocol_1_1DBC__IndexedUpload.html">DBC_IndexedUpload</a>       index_upload;
<a name="l00503"></a>00503                 uint8_t                 raw[1];
<a name="l00504"></a>00504 
<a name="l00505"></a>00505         } __attribute__ ((packed)) u;
<a name="l00506"></a>00506 } __attribute__ ((packed));
<a name="l00507"></a>00507 <span class="preprocessor">#define DB_COMMAND_HEADER_SIZE          (sizeof(::Barry::Protocol::DBCommand) - sizeof(::Barry::Protocol::DBCommand::Parameters))</span>
<a name="l00508"></a>00508 <span class="preprocessor"></span>
<a name="l00509"></a>00509 
<a name="l00510"></a>00510 <span class="comment"></span>
<a name="l00511"></a>00511 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00512"></a>00512 <span class="comment"></span><span class="comment">// Protocol response parameter structures</span>
<a name="l00513"></a>00513 
<a name="l00514"></a><a class="code" href="structBarry_1_1Protocol_1_1DBR__OldDBDBRecord.html">00514</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1DBR__OldDBDBRecord.html">DBR_OldDBDBRecord</a>
<a name="l00515"></a>00515 {
<a name="l00516"></a>00516         uint16_t        count;                  <span class="comment">// number of fields in record</span>
<a name="l00517"></a>00517         <a class="code" href="structBarry_1_1Protocol_1_1OldDBDBField.html">OldDBDBField</a>    field[1];
<a name="l00518"></a>00518 } __attribute__ ((packed));
<a name="l00519"></a>00519 <span class="preprocessor">#define OLD_DBDB_RECORD_HEADER_SIZE     (sizeof(::Barry::Protocol::DBR_OldDBDBRecord) - sizeof(::Barry::Protocol::OldDBDBField))</span>
<a name="l00520"></a>00520 <span class="preprocessor"></span>
<a name="l00521"></a><a class="code" href="structBarry_1_1Protocol_1_1DBR__DBDBRecord.html">00521</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1DBR__DBDBRecord.html">DBR_DBDBRecord</a>
<a name="l00522"></a>00522 {
<a name="l00523"></a>00523         uint16_t        count;
<a name="l00524"></a>00524         uint8_t         unknown[3];
<a name="l00525"></a>00525         <a class="code" href="structBarry_1_1Protocol_1_1DBDBField.html">DBDBField</a>       field[1];
<a name="l00526"></a>00526 } __attribute__ ((packed));
<a name="l00527"></a>00527 <span class="preprocessor">#define DBDB_RECORD_HEADER_SIZE         (sizeof(::Barry::Protocol::DBR_DBDBRecord) - sizeof(::Barry::Protocol::DBDBField))</span>
<a name="l00528"></a>00528 <span class="preprocessor"></span>
<a name="l00529"></a>00529 <span class="comment">// Records with a uniqueId.  This covers the following records:</span>
<a name="l00530"></a>00530 <span class="comment">//</span>
<a name="l00531"></a>00531 <span class="comment">//      Old Contact records</span>
<a name="l00532"></a>00532 <span class="comment">//      Old Service Book records</span>
<a name="l00533"></a>00533 <span class="comment">//      Old Calendar records</span>
<a name="l00534"></a>00534 <span class="comment">//</span>
<a name="l00535"></a><a class="code" href="structBarry_1_1Protocol_1_1DBR__OldTaggedRecord.html">00535</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1DBR__OldTaggedRecord.html">DBR_OldTaggedRecord</a>
<a name="l00536"></a>00536 {
<a name="l00537"></a>00537         uint8_t         rectype;
<a name="l00538"></a>00538         uint16_t        index;
<a name="l00539"></a>00539         uint32_t        uniqueId;
<a name="l00540"></a>00540         uint8_t         unknown2;
<a name="l00541"></a>00541 
<a name="l00542"></a><a class="code" href="unionBarry_1_1Protocol_1_1DBR__OldTaggedRecord_1_1TaggedData.html">00542</a>         <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1DBR__OldTaggedRecord_1_1TaggedData.html">TaggedData</a>
<a name="l00543"></a>00543         {
<a name="l00544"></a>00544                 <a class="code" href="structBarry_1_1Protocol_1_1CommonField.html">CommonField</a>     field[1];
<a name="l00545"></a>00545         } __attribute__ ((packed)) u;
<a name="l00546"></a>00546 } __attribute__ ((packed));
<a name="l00547"></a>00547 <span class="preprocessor">#define DBR_OLD_TAGGED_RECORD_HEADER_SIZE (sizeof(::Barry::Protocol::DBR_OldTaggedRecord) - sizeof(::Barry::Protocol::DBR_OldTaggedRecord::TaggedData))</span>
<a name="l00548"></a>00548 <span class="preprocessor"></span>
<a name="l00549"></a><a class="code" href="structBarry_1_1Protocol_1_1MessageRecord.html">00549</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1MessageRecord.html">MessageRecord</a>
<a name="l00550"></a>00550 {
<a name="l00551"></a>00551         uint8_t         field1;         <span class="comment">// always &#39;j&#39;</span>
<a name="l00552"></a>00552         uint32_t        field2;         <span class="comment">// always 0x00000000</span>
<a name="l00553"></a>00553         uint32_t        flags;          <span class="comment">// flags</span>
<a name="l00554"></a>00554         uint32_t        field4;         <span class="comment">// normal email and pin recv this is 0x7ff</span>
<a name="l00555"></a>00555                                         <span class="comment">// changes on sent and reply to 0x01ffffff</span>
<a name="l00556"></a>00556                                         <span class="comment">// and 0x003fffff on pin send</span>
<a name="l00557"></a>00557         uint32_t        field5;         <span class="comment">// always 0x00000000</span>
<a name="l00558"></a>00558         uint32_t        field6;         <span class="comment">// always 0x00000000</span>
<a name="l00559"></a>00559         uint32_t        field7;         <span class="comment">// always 0x00000000</span>
<a name="l00560"></a>00560         uint32_t        field8;         <span class="comment">// always 0x00000000</span>
<a name="l00561"></a>00561         uint16_t        field9;         <span class="comment">// always 0x0000</span>
<a name="l00562"></a>00562 
<a name="l00563"></a>00563         uint16_t        dateReceived;   <span class="comment">// the first two of these time fields are always the same</span>
<a name="l00564"></a>00564         uint16_t        timeReceived;   <span class="comment">//</span>
<a name="l00565"></a>00565         uint16_t        dateDuplicate;  <span class="comment">// On mail sent from the BB all three fields are identical</span>
<a name="l00566"></a>00566         uint16_t        timeDuplicate;  <span class="comment">// (time sent)</span>
<a name="l00567"></a>00567         uint16_t        dateSent;
<a name="l00568"></a>00568         uint16_t        timeSent;
<a name="l00569"></a>00569 
<a name="l00570"></a>00570         uint16_t        priority;       <span class="comment">// priority field</span>
<a name="l00571"></a>00571         uint32_t        field14;        <span class="comment">// always 0x00000000</span>
<a name="l00572"></a>00572         uint32_t        field15;        <span class="comment">// always 0x00000000</span>
<a name="l00573"></a>00573         uint16_t        field16;        <span class="comment">// always 0x0000</span>
<a name="l00574"></a>00574         uint32_t        field13;        <span class="comment">// PIN reply 0x00000000 other time 0xffffffff or 0xfffffffe</span>
<a name="l00575"></a>00575         uint16_t        messageSize;    <span class="comment">// Message size, 0x0000 if Reply or Saved, 0xffff if below ????</span>
<a name="l00576"></a>00576         uint32_t        field18;        <span class="comment">// 0x0&#39;s and 0xF&#39;x</span>
<a name="l00577"></a>00577         uint32_t        field19;        <span class="comment">// 0x0&#39;s and 0xF&#39;s</span>
<a name="l00578"></a>00578         uint16_t        field20;        <span class="comment">// always 0x0000</span>
<a name="l00579"></a>00579         uint16_t        field21;        <span class="comment">// 0x01 unless PIN reply then 0x00</span>
<a name="l00580"></a>00580         uint32_t        inReplyTo;      <span class="comment">// reply to message?</span>
<a name="l00581"></a>00581         uint32_t        field22;        <span class="comment">// always 0x00000000</span>
<a name="l00582"></a>00582         uint16_t        field23;        <span class="comment">// FIXME</span>
<a name="l00583"></a>00583 
<a name="l00584"></a>00584         uint32_t        folderOne;      <span class="comment">// these are the &#39;folders&#39; the message is in</span>
<a name="l00585"></a>00585         uint32_t        folderTwo;      <span class="comment">//</span>
<a name="l00586"></a>00586 
<a name="l00587"></a>00587         uint16_t        replyMessageFlags;      <span class="comment">// 0xfffe on recvd messages</span>
<a name="l00588"></a>00588                                         <span class="comment">// 0x001b on reply</span>
<a name="l00589"></a>00589                                         <span class="comment">// 0x0015 on send</span>
<a name="l00590"></a>00590                                         <span class="comment">// 0x3 pin send</span>
<a name="l00591"></a>00591                                         <span class="comment">// 0x2 on pin recv</span>
<a name="l00592"></a>00592         uint16_t        field27;        <span class="comment">// set to 0x00000004 on PIN reply, 0x00000005 otherwise</span>
<a name="l00593"></a>00593         uint32_t        headerUID;      <span class="comment">// yet another copy of the UID (RecId)</span>
<a name="l00594"></a>00594 
<a name="l00595"></a>00595         uint32_t        field29;        <span class="comment">// always 0x00000000</span>
<a name="l00596"></a>00596         uint16_t        field30;        <span class="comment">// always 0x0002</span>
<a name="l00597"></a>00597         uint16_t        field31;        <span class="comment">// always 0x00000000</span>
<a name="l00598"></a>00598         uint16_t        field32;        <span class="comment">// always 0x0004</span>
<a name="l00599"></a>00599         uint16_t        field34;        <span class="comment">// always 0x0000</span>
<a name="l00600"></a>00600         uint8_t         field33;        <span class="comment">// always &#39;d&#39;</span>
<a name="l00601"></a>00601         uint32_t        timeBlock;      <span class="comment">// FIXME</span>
<a name="l00602"></a>00602         <a class="code" href="structBarry_1_1Protocol_1_1CommonField.html">CommonField</a>     field[1];
<a name="l00603"></a>00603 } __attribute__ ((packed));
<a name="l00604"></a>00604 <span class="preprocessor">#define MESSAGE_RECORD_HEADER_SIZE (sizeof(::Barry::Protocol::MessageRecord) - sizeof(::Barry::Protocol::CommonField))</span>
<a name="l00605"></a>00605 <span class="preprocessor"></span>
<a name="l00606"></a>00606 
<a name="l00607"></a>00607 <span class="comment"></span>
<a name="l00608"></a>00608 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00609"></a>00609 <span class="comment"></span><span class="comment">// Protocol response structures</span>
<a name="l00610"></a>00610 
<a name="l00611"></a><a class="code" href="structBarry_1_1Protocol_1_1DBResponse.html">00611</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1DBResponse.html">DBResponse</a>
<a name="l00612"></a>00612 {
<a name="l00613"></a>00613         uint8_t         operation;
<a name="l00614"></a>00614 
<a name="l00615"></a><a class="code" href="unionBarry_1_1Protocol_1_1DBResponse_1_1Parameters.html">00615</a>         <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1DBResponse_1_1Parameters.html">Parameters</a>
<a name="l00616"></a>00616         {
<a name="l00617"></a>00617 
<a name="l00618"></a>00618                 <a class="code" href="structBarry_1_1Protocol_1_1DBR__OldTaggedRecord.html">DBR_OldTaggedRecord</a>     tagged;
<a name="l00619"></a>00619                 <a class="code" href="structBarry_1_1Protocol_1_1DBR__OldDBDBRecord.html">DBR_OldDBDBRecord</a>       old_dbdb;
<a name="l00620"></a>00620                 <a class="code" href="structBarry_1_1Protocol_1_1DBR__DBDBRecord.html">DBR_DBDBRecord</a>          dbdb;
<a name="l00621"></a>00621 
<a name="l00622"></a>00622         } __attribute__ ((packed)) u;
<a name="l00623"></a>00623 
<a name="l00624"></a>00624 } __attribute__ ((packed));
<a name="l00625"></a>00625 <span class="preprocessor">#define DB_RESPONSE_HEADER_SIZE         (sizeof(::Barry::Protocol::DBResponse) - sizeof(::Barry::Protocol::DBResponse::Parameters))</span>
<a name="l00626"></a>00626 <span class="preprocessor"></span>
<a name="l00627"></a>00627 
<a name="l00628"></a>00628 <span class="comment"></span>
<a name="l00629"></a>00629 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00630"></a>00630 <span class="comment"></span><span class="comment">// Database access command structure</span>
<a name="l00631"></a>00631 
<a name="l00632"></a>00632 <span class="comment">// even fragmented packets have a tableCmd</span>
<a name="l00633"></a><a class="code" href="structBarry_1_1Protocol_1_1DBAccess.html">00633</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1DBAccess.html">DBAccess</a>
<a name="l00634"></a>00634 {
<a name="l00635"></a>00635         uint8_t         tableCmd;
<a name="l00636"></a>00636 
<a name="l00637"></a><a class="code" href="unionBarry_1_1Protocol_1_1DBAccess_1_1DBData.html">00637</a>         <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1DBAccess_1_1DBData.html">DBData</a>
<a name="l00638"></a>00638         {
<a name="l00639"></a>00639                 <a class="code" href="structBarry_1_1Protocol_1_1DBCommand.html">DBCommand</a>               command;
<a name="l00640"></a>00640                 <a class="code" href="structBarry_1_1Protocol_1_1DBResponse.html">DBResponse</a>              response;
<a name="l00641"></a>00641                 <a class="code" href="structBarry_1_1Protocol_1_1CommandTableField.html">CommandTableField</a>       table[1];
<a name="l00642"></a>00642                 uint8_t                 return_code;
<a name="l00643"></a>00643                 uint8_t                 fragment[1];
<a name="l00644"></a>00644 
<a name="l00645"></a>00645         } __attribute__ ((packed)) u;
<a name="l00646"></a>00646 } __attribute__ ((packed));
<a name="l00647"></a>00647 <span class="preprocessor">#define SB_DBACCESS_HEADER_SIZE                 (sizeof(::Barry::Protocol::DBAccess) - sizeof(::Barry::Protocol::DBAccess::DBData))</span>
<a name="l00648"></a>00648 <span class="preprocessor"></span><span class="preprocessor">#define SB_DBACCESS_RETURN_CODE_SIZE            (1)</span>
<a name="l00649"></a>00649 <span class="preprocessor"></span>
<a name="l00650"></a>00650 
<a name="l00651"></a>00651 <span class="comment"></span>
<a name="l00652"></a>00652 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00653"></a>00653 <span class="comment"></span><span class="comment">// Javaloader protocol structure</span>
<a name="l00654"></a>00654 
<a name="l00655"></a><a class="code" href="structBarry_1_1Protocol_1_1JLDirEntry.html">00655</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JLDirEntry.html">JLDirEntry</a>
<a name="l00656"></a>00656 {
<a name="l00657"></a>00657         uint16_t        unknown;
<a name="l00658"></a>00658         uint32_t        timestamp;
<a name="l00659"></a>00659         uint16_t        filename_size;
<a name="l00660"></a>00660         uint8_t         filename[1];
<a name="l00661"></a>00661         <span class="comment">// the rest of the packet is variable length</span>
<a name="l00662"></a>00662         <span class="comment">// another string for version, then:</span>
<a name="l00663"></a>00663         <span class="comment">// uint32_t     cod_size;</span>
<a name="l00664"></a>00664 
<a name="l00665"></a>00665 } __attribute__ ((packed));
<a name="l00666"></a>00666 <span class="preprocessor">#define SB_JLDIRENTRY_HEADER_SIZE               (sizeof(::Barry::Protocol::JLDirEntry) - 1)</span>
<a name="l00667"></a>00667 <span class="preprocessor"></span>
<a name="l00668"></a><a class="code" href="structBarry_1_1Protocol_1_1JLCommand.html">00668</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JLCommand.html">JLCommand</a>
<a name="l00669"></a>00669 {
<a name="l00670"></a>00670         uint8_t         command;
<a name="l00671"></a>00671         uint8_t         unknown;        <span class="comment">// nearly always 0, might be top half of command</span>
<a name="l00672"></a>00672         uint16_t        size;
<a name="l00673"></a>00673 } __attribute__ ((packed));
<a name="l00674"></a>00674 <span class="preprocessor">#define SB_JLCOMMAND_HEADER_SIZE                (sizeof(::Barry::Protocol::JLCommand))</span>
<a name="l00675"></a>00675 <span class="preprocessor"></span>
<a name="l00676"></a><a class="code" href="structBarry_1_1Protocol_1_1JLResponse.html">00676</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JLResponse.html">JLResponse</a>
<a name="l00677"></a>00677 {
<a name="l00678"></a>00678         uint8_t         command;
<a name="l00679"></a>00679         uint8_t         unknown;
<a name="l00680"></a>00680         uint16_t        expect;
<a name="l00681"></a>00681 } __attribute__ ((packed));
<a name="l00682"></a>00682 <span class="preprocessor">#define SB_JLRESPONSE_HEADER_SIZE               (sizeof(::Barry::Protocol::JLResponse))</span>
<a name="l00683"></a>00683 <span class="preprocessor"></span>
<a name="l00684"></a><a class="code" href="structBarry_1_1Protocol_1_1JLScreenInfo.html">00684</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JLScreenInfo.html">JLScreenInfo</a>
<a name="l00685"></a>00685 {
<a name="l00686"></a>00686         uint16_t        unknown1;
<a name="l00687"></a>00687         uint16_t        unknown2;
<a name="l00688"></a>00688         uint16_t        unknown3;
<a name="l00689"></a>00689         uint16_t        width;
<a name="l00690"></a>00690         uint16_t        height;
<a name="l00691"></a>00691         uint16_t        unknown4;
<a name="l00692"></a>00692         uint16_t        unknown5;
<a name="l00693"></a>00693         uint16_t        unknown6;
<a name="l00694"></a>00694 } __attribute__ ((packed));
<a name="l00695"></a>00695 <span class="preprocessor">#define SB_JLSCREENINFO_SIZE                    (sizeof(::Barry::Protocol::JLScreenInfo))</span>
<a name="l00696"></a>00696 <span class="preprocessor"></span>
<a name="l00697"></a><a class="code" href="structBarry_1_1Protocol_1_1JLEventlogEntry.html">00697</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JLEventlogEntry.html">JLEventlogEntry</a>
<a name="l00698"></a>00698 {
<a name="l00699"></a>00699         uint16_t        size;
<a name="l00700"></a>00700         <span class="comment">// remainder of packet is variable</span>
<a name="l00701"></a>00701         <span class="comment">// it contains the log data as an ASCII (UTF-8?) string</span>
<a name="l00702"></a>00702 } __attribute__ ((packed));
<a name="l00703"></a>00703 <span class="preprocessor">#define SB_JLEVENTLOG_ENTRY_HEADER_SIZE         (sizeof(::Barry::Protocol::JLEventlogEntry))</span>
<a name="l00704"></a>00704 <span class="preprocessor"></span>
<a name="l00705"></a><a class="code" href="structBarry_1_1Protocol_1_1JLDeviceInfo.html">00705</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JLDeviceInfo.html">JLDeviceInfo</a>
<a name="l00706"></a>00706 {
<a name="l00707"></a>00707         uint32_t        hardware_id;
<a name="l00708"></a>00708         uint32_t        pin;
<a name="l00709"></a>00709         uint32_t        os_version;
<a name="l00710"></a>00710         uint32_t        vm_version;
<a name="l00711"></a>00711         uint32_t        radio_id;
<a name="l00712"></a>00712         uint32_t        vendor_id;
<a name="l00713"></a>00713         uint32_t        active_wafs;
<a name="l00714"></a>00714         <span class="comment">// older devices (such as 7130) don&#39;t this extra data in the</span>
<a name="l00715"></a>00715         <span class="comment">// device info packet and will therefore fail the size check</span>
<a name="l00716"></a>00716         <span class="comment">//uint8_t               raw[4];</span>
<a name="l00717"></a>00717 } __attribute__ ((packed));
<a name="l00718"></a>00718 <span class="preprocessor">#define SB_JLDEVICEINFO_SIZE                    (sizeof(::Barry::Protocol::JLDeviceInfo))</span>
<a name="l00719"></a>00719 <span class="preprocessor"></span>
<a name="l00720"></a><a class="code" href="structBarry_1_1Protocol_1_1JLPacket.html">00720</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JLPacket.html">JLPacket</a>
<a name="l00721"></a>00721 {
<a name="l00722"></a>00722         uint16_t        socket;
<a name="l00723"></a>00723         uint16_t        size;           <span class="comment">// total size of data packet</span>
<a name="l00724"></a>00724 
<a name="l00725"></a><a class="code" href="unionBarry_1_1Protocol_1_1JLPacket_1_1PacketData.html">00725</a>         <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1JLPacket_1_1PacketData.html">PacketData</a>
<a name="l00726"></a>00726         {
<a name="l00727"></a>00727                 <a class="code" href="structBarry_1_1Protocol_1_1JLCommand.html">JLCommand</a>               command;
<a name="l00728"></a>00728                 <a class="code" href="structBarry_1_1Protocol_1_1JLResponse.html">JLResponse</a>              response;
<a name="l00729"></a>00729                 <a class="code" href="structBarry_1_1Protocol_1_1JLScreenInfo.html">JLScreenInfo</a>            screeninfo;
<a name="l00730"></a>00730                 <a class="code" href="structBarry_1_1Protocol_1_1JLEventlogEntry.html">JLEventlogEntry</a>         logentry;
<a name="l00731"></a>00731                 <a class="code" href="structBarry_1_1Protocol_1_1JLDeviceInfo.html">JLDeviceInfo</a>            devinfo;
<a name="l00732"></a>00732                 uint8_t                 raw[1];
<a name="l00733"></a>00733                 <span class="keywordtype">char</span>                    filename[1];
<a name="l00734"></a>00734                 uint32_t                cod_size;
<a name="l00735"></a>00735                 uint32_t                timestamp;
<a name="l00736"></a>00736                 uint16_t                id;
<a name="l00737"></a>00737         } __attribute__ ((packed)) u;
<a name="l00738"></a>00738 
<a name="l00739"></a>00739 } __attribute__ ((packed));
<a name="l00740"></a>00740 <span class="preprocessor">#define SB_JLPACKET_HEADER_SIZE         (sizeof(::Barry::Protocol::JLPacket) - sizeof(::Barry::Protocol::JLPacket::PacketData))</span>
<a name="l00741"></a>00741 <span class="preprocessor"></span>
<a name="l00742"></a>00742 <span class="comment"></span>
<a name="l00743"></a>00743 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00744"></a>00744 <span class="comment"></span><span class="comment">// JavaDebug protocol structures</span>
<a name="l00745"></a>00745 
<a name="l00746"></a>00746 <span class="keyword">namespace </span>JDWP {
<a name="l00747"></a>00747 
<a name="l00748"></a>00748         <span class="comment">// Packet command</span>
<a name="l00749"></a>00749         <span class="comment">//----------------</span>
<a name="l00750"></a>00750 
<a name="l00751"></a><a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketEventRequestSet.html">00751</a>         <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketEventRequestSet.html">PacketEventRequestSet</a> {
<a name="l00752"></a>00752                 uint8_t eventKind;
<a name="l00753"></a>00753                 uint8_t suspendPolicy;
<a name="l00754"></a>00754                 uint32_t modifiers;
<a name="l00755"></a>00755         } __attribute__ ((packed));
<a name="l00756"></a>00756 
<a name="l00757"></a>00757 
<a name="l00758"></a><a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketEventRequest.html">00758</a>         <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketEventRequest.html">PacketEventRequest</a> {
<a name="l00759"></a><a class="code" href="unionBarry_1_1Protocol_1_1JDWP_1_1PacketEventRequest_1_1PacketEventRequestData.html">00759</a>                 <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1JDWP_1_1PacketEventRequest_1_1PacketEventRequestData.html">PacketEventRequestData</a> {
<a name="l00760"></a>00760                         <a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketEventRequestSet.html">PacketEventRequestSet</a> <span class="keyword">set</span>;
<a name="l00761"></a>00761                 } __attribute__ ((packed)) u;
<a name="l00762"></a>00762         } __attribute__ ((packed));
<a name="l00763"></a>00763 
<a name="l00764"></a>00764 
<a name="l00765"></a><a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketCommand.html">00765</a>         struct <a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketCommand.html">PacketCommand</a> {
<a name="l00766"></a>00766                 uint8_t commandset;
<a name="l00767"></a>00767                 uint8_t command;
<a name="l00768"></a>00768 
<a name="l00769"></a><a class="code" href="unionBarry_1_1Protocol_1_1JDWP_1_1PacketCommand_1_1PacketCommandData.html">00769</a>                 <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1JDWP_1_1PacketCommand_1_1PacketCommandData.html">PacketCommandData</a> {
<a name="l00770"></a>00770                         <a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketEventRequest.html">PacketEventRequest</a> eventRequest;
<a name="l00771"></a>00771                 } __attribute__ ((packed)) u;
<a name="l00772"></a>00772         } __attribute__ ((packed));
<a name="l00773"></a>00773         <span class="preprocessor">#define JDWP_COMMAND_HEADER_SIZE                        (sizeof(::Barry::Protocol::JDWP::PacketCommand))</span>
<a name="l00774"></a>00774 <span class="preprocessor"></span>
<a name="l00775"></a>00775 
<a name="l00776"></a>00776         <span class="comment">// Packet response</span>
<a name="l00777"></a>00777         <span class="comment">//-----------------</span>
<a name="l00778"></a>00778 
<a name="l00779"></a><a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketVirtualMachineIDSizes.html">00779</a>         <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketVirtualMachineIDSizes.html">PacketVirtualMachineIDSizes</a> {
<a name="l00780"></a>00780                 uint32_t fieldIDSize;
<a name="l00781"></a>00781                 uint32_t methodIDSize;
<a name="l00782"></a>00782                 uint32_t objectIDSize;
<a name="l00783"></a>00783                 uint32_t referenceTypeIDSize;
<a name="l00784"></a>00784                 uint32_t frameIDSize;
<a name="l00785"></a>00785         } __attribute__ ((packed));
<a name="l00786"></a>00786 
<a name="l00787"></a>00787 <span class="preprocessor">        #define JDWP_PACKETVIRTUALMACHINEIDSIZES_DATA_SIZE              sizeof(::Barry::Protocol::JDWP::PacketVirtualMachineIDSizes)</span>
<a name="l00788"></a>00788 <span class="preprocessor"></span>
<a name="l00789"></a>00789 
<a name="l00790"></a><a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketVirtualMachine.html">00790</a>         <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketVirtualMachine.html">PacketVirtualMachine</a> {
<a name="l00791"></a><a class="code" href="unionBarry_1_1Protocol_1_1JDWP_1_1PacketVirtualMachine_1_1PacketVirtualMachineData.html">00791</a>                 <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1JDWP_1_1PacketVirtualMachine_1_1PacketVirtualMachineData.html">PacketVirtualMachineData</a> {
<a name="l00792"></a>00792                         <a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketVirtualMachineIDSizes.html">PacketVirtualMachineIDSizes</a> IDSizes;
<a name="l00793"></a>00793                 } __attribute__ ((packed)) u;
<a name="l00794"></a>00794         } __attribute__ ((packed));
<a name="l00795"></a>00795 
<a name="l00796"></a>00796 
<a name="l00797"></a><a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketResponse.html">00797</a>         struct <a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketResponse.html">PacketResponse</a> {
<a name="l00798"></a>00798                 uint16_t errorcode;
<a name="l00799"></a>00799 
<a name="l00800"></a><a class="code" href="unionBarry_1_1Protocol_1_1JDWP_1_1PacketResponse_1_1PacketResponseData.html">00800</a>                 <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1JDWP_1_1PacketResponse_1_1PacketResponseData.html">PacketResponseData</a> {
<a name="l00801"></a>00801                         <a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1PacketVirtualMachine.html">PacketVirtualMachine</a> virtualMachine;
<a name="l00802"></a>00802                         uint32_t value;
<a name="l00803"></a>00803                         uint8_t raw[1];
<a name="l00804"></a>00804                 } __attribute__ ((packed)) u;
<a name="l00805"></a>00805         } __attribute__ ((packed));
<a name="l00806"></a>00806         <span class="preprocessor">#define JDWP_RESPONSE_HEADER_SIZE                       (sizeof(::Barry::Protocol::JDWP::PacketResponse) - sizeof(::Barry::Protocol::JDWP::PacketResponse::PacketResponseData))</span>
<a name="l00807"></a>00807 <span class="preprocessor"></span>
<a name="l00808"></a>00808 
<a name="l00809"></a>00809         <span class="comment">// Generic packet</span>
<a name="l00810"></a>00810         <span class="comment">//----------------</span>
<a name="l00811"></a>00811 
<a name="l00812"></a><a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1Packet.html">00812</a>         <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JDWP_1_1Packet.html">Packet</a> {
<a name="l00813"></a>00813                 uint32_t length;
<a name="l00814"></a>00814                 uint32_t id;
<a name="l00815"></a>00815                 uint8_t flags;
<a name="l00816"></a>00816 
<a name="l00817"></a><a class="code" href="unionBarry_1_1Protocol_1_1JDWP_1_1Packet_1_1PacketType.html">00817</a>                 <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1JDWP_1_1Packet_1_1PacketType.html">PacketType</a> {
<a name="l00818"></a>00818                         PacketCommand command;
<a name="l00819"></a>00819                         PacketResponse response;
<a name="l00820"></a>00820                 } __attribute__ ((packed)) u;
<a name="l00821"></a>00821         } __attribute__ ((packed));
<a name="l00822"></a>00822         <span class="preprocessor">#define JDWP_PACKET_HEADER_SIZE                 (sizeof(::Barry::Protocol::JDWP::Packet) - sizeof(::Barry::Protocol::JDWP::Packet::PacketType))</span>
<a name="l00823"></a>00823 <span class="preprocessor"></span>
<a name="l00824"></a>00824 
<a name="l00825"></a>00825 <span class="preprocessor">        #define MAKE_JDWPPACKET(var, data)              const ::Barry::Protocol::JDWP::Packet *var = (const ::Barry::Protocol::JDWP::Packet *) (data).GetData()</span>
<a name="l00826"></a>00826 <span class="preprocessor"></span><span class="preprocessor">        #define MAKE_JDWPPACKETPTR_BUF(var, ptr)                ::Barry::Protocol::JDWP::Packet *var = (::Barry::Protocol::JDWP::Packet *)ptr</span>
<a name="l00827"></a>00827 <span class="preprocessor"></span>
<a name="l00828"></a>00828 
<a name="l00829"></a>00829 } <span class="comment">// namespace JDWP</span>
<a name="l00830"></a>00830 
<a name="l00831"></a><a class="code" href="structBarry_1_1Protocol_1_1JDWField.html">00831</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JDWField.html">JDWField</a> {
<a name="l00832"></a>00832         uint32_t size;
<a name="l00833"></a>00833 
<a name="l00834"></a><a class="code" href="unionBarry_1_1Protocol_1_1JDWField_1_1JDWFieldData.html">00834</a>         <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1JDWField_1_1JDWFieldData.html">JDWFieldData</a> {
<a name="l00835"></a>00835                 uint8_t raw[1];
<a name="l00836"></a>00836         } __attribute__ ((packed)) u;
<a name="l00837"></a>00837 } __attribute__ ((packed));
<a name="l00838"></a>00838 <span class="preprocessor">#define JDWP_FIELD_HEADER_SIZE                  (sizeof(::Barry::Protocol::JDWField) - sizeof(::Barry::Protocol::JDWField::JDWFieldData))</span>
<a name="l00839"></a>00839 <span class="preprocessor"></span>
<a name="l00840"></a><a class="code" href="structBarry_1_1Protocol_1_1JVMCommand.html">00840</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JVMCommand.html">JVMCommand</a>
<a name="l00841"></a>00841 {
<a name="l00842"></a>00842         uint16_t        size;
<a name="l00843"></a>00843         uint8_t         command;
<a name="l00844"></a>00844         uint8_t         raw[1];
<a name="l00845"></a>00845 } __attribute__ ((packed));
<a name="l00846"></a>00846 <span class="preprocessor">#define SB_JVMCOMMAND_HEADER_SIZE               (sizeof(::Barry::Protocol::JVMCommand))</span>
<a name="l00847"></a>00847 <span class="preprocessor"></span>
<a name="l00848"></a><a class="code" href="structBarry_1_1Protocol_1_1JVMResponse.html">00848</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JVMResponse.html">JVMResponse</a>
<a name="l00849"></a>00849 {
<a name="l00850"></a>00850         uint8_t         command;
<a name="l00851"></a>00851         uint8_t         unknown;
<a name="l00852"></a>00852         uint16_t        expect;
<a name="l00853"></a>00853 } __attribute__ ((packed));
<a name="l00854"></a>00854 <span class="preprocessor">#define SB_JVMRESPONSE_HEADER_SIZE              (sizeof(::Barry::Protocol::JVMResponse))</span>
<a name="l00855"></a>00855 <span class="preprocessor"></span>
<a name="l00856"></a><a class="code" href="structBarry_1_1Protocol_1_1JVMModulesList.html">00856</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JVMModulesList.html">JVMModulesList</a>
<a name="l00857"></a>00857 {
<a name="l00858"></a>00858         uint32_t        nbr;
<a name="l00859"></a>00859         <span class="comment">// remainder of packet is variable</span>
<a name="l00860"></a>00860         <span class="comment">// it contains the modules list </span>
<a name="l00861"></a>00861 } __attribute__ ((packed));
<a name="l00862"></a>00862 <span class="preprocessor">#define SB_JVMMODULES_LIST_HEADER_SIZE          (sizeof(::Barry::Protocol::JVMModulesList))</span>
<a name="l00863"></a>00863 <span class="preprocessor"></span>
<a name="l00864"></a><a class="code" href="structBarry_1_1Protocol_1_1JVMModulesEntry.html">00864</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JVMModulesEntry.html">JVMModulesEntry</a>
<a name="l00865"></a>00865 {
<a name="l00866"></a>00866         uint32_t        id;
<a name="l00867"></a>00867         uint32_t        uniqueId;
<a name="l00868"></a>00868         uint16_t        sizename;
<a name="l00869"></a>00869         <span class="comment">// remainder of packet is variable</span>
<a name="l00870"></a>00870         <span class="comment">// it contains the module name</span>
<a name="l00871"></a>00871 } __attribute__ ((packed));
<a name="l00872"></a>00872 <span class="preprocessor">#define SB_JVMMODULES_ENTRY_HEADER_SIZE         (sizeof(::Barry::Protocol::JVMModulesEntry))</span>
<a name="l00873"></a>00873 <span class="preprocessor"></span>
<a name="l00874"></a><a class="code" href="structBarry_1_1Protocol_1_1JVMThreadsList.html">00874</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JVMThreadsList.html">JVMThreadsList</a>
<a name="l00875"></a>00875 {
<a name="l00876"></a>00876         uint32_t        nbr;
<a name="l00877"></a>00877         <span class="comment">// remainder of packet is variable</span>
<a name="l00878"></a>00878         <span class="comment">// it contains the threads list </span>
<a name="l00879"></a>00879 } __attribute__ ((packed));
<a name="l00880"></a>00880 <span class="preprocessor">#define SB_JVMTHREADS_LIST_HEADER_SIZE          (sizeof(::Barry::Protocol::JVMThreadsList))</span>
<a name="l00881"></a>00881 <span class="preprocessor"></span>
<a name="l00882"></a><a class="code" href="structBarry_1_1Protocol_1_1JVMUnknown01.html">00882</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JVMUnknown01.html">JVMUnknown01</a>
<a name="l00883"></a>00883 {
<a name="l00884"></a>00884         uint8_t         byte;
<a name="l00885"></a>00885         uint32_t        address;
<a name="l00886"></a>00886 } __attribute__ ((packed));
<a name="l00887"></a>00887 <span class="preprocessor">#define SB_JVMUNKNOWN01_HEADER_SIZE                     (sizeof(::Barry::Protocol::JVMUnknown01))</span>
<a name="l00888"></a>00888 <span class="preprocessor"></span>
<a name="l00889"></a><a class="code" href="structBarry_1_1Protocol_1_1JVMUnknown02.html">00889</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JVMUnknown02.html">JVMUnknown02</a>
<a name="l00890"></a>00890 {
<a name="l00891"></a>00891         uint32_t        address1;
<a name="l00892"></a>00892         uint32_t        address2;
<a name="l00893"></a>00893 } __attribute__ ((packed));
<a name="l00894"></a>00894 <span class="preprocessor">#define SB_JVMUNKNOWN02_HEADER_SIZE                     (sizeof(::Barry::Protocol::JVMUnknown02))</span>
<a name="l00895"></a>00895 <span class="preprocessor"></span>
<a name="l00896"></a><a class="code" href="structBarry_1_1Protocol_1_1JVMPacket.html">00896</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1JVMPacket.html">JVMPacket</a>
<a name="l00897"></a>00897 {
<a name="l00898"></a>00898         uint16_t        socket;
<a name="l00899"></a>00899         uint16_t        size;           <span class="comment">// total size of data packet</span>
<a name="l00900"></a>00900 
<a name="l00901"></a><a class="code" href="unionBarry_1_1Protocol_1_1JVMPacket_1_1PacketData.html">00901</a>         <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1JVMPacket_1_1PacketData.html">PacketData</a>
<a name="l00902"></a>00902         {
<a name="l00903"></a>00903                 <a class="code" href="structBarry_1_1Protocol_1_1JVMCommand.html">JVMCommand</a>              command;
<a name="l00904"></a>00904                 <a class="code" href="structBarry_1_1Protocol_1_1JVMResponse.html">JVMResponse</a>             response;
<a name="l00905"></a>00905                 <a class="code" href="structBarry_1_1Protocol_1_1JVMModulesList.html">JVMModulesList</a>          moduleslist;
<a name="l00906"></a>00906                 <a class="code" href="structBarry_1_1Protocol_1_1JVMThreadsList.html">JVMThreadsList</a>          threadslist;
<a name="l00907"></a>00907                 <a class="code" href="structBarry_1_1Protocol_1_1JVMUnknown01.html">JVMUnknown01</a>            unknown01;
<a name="l00908"></a>00908                 <a class="code" href="structBarry_1_1Protocol_1_1JVMUnknown02.html">JVMUnknown02</a>            unknown02;
<a name="l00909"></a>00909                 uint32_t                address;
<a name="l00910"></a>00910                 uint16_t                expect;
<a name="l00911"></a>00911                 uint16_t                msglength;
<a name="l00912"></a>00912                 uint16_t                value;
<a name="l00913"></a>00913                 uint8_t                 status;
<a name="l00914"></a>00914                 uint8_t                 raw[1];
<a name="l00915"></a>00915         } __attribute__ ((packed)) u;
<a name="l00916"></a>00916 
<a name="l00917"></a>00917 } __attribute__ ((packed));
<a name="l00918"></a>00918 <span class="preprocessor">#define SB_JVMPACKET_HEADER_SIZE                (sizeof(::Barry::Protocol::JVMPacket) - sizeof(::Barry::Protocol::JVMPacket::PacketData))</span>
<a name="l00919"></a>00919 <span class="preprocessor"></span>
<a name="l00920"></a>00920 <span class="comment"></span>
<a name="l00921"></a>00921 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00922"></a>00922 <span class="comment"></span><span class="comment">// Main packet struct</span>
<a name="l00923"></a>00923 
<a name="l00924"></a><a class="code" href="structBarry_1_1Protocol_1_1Packet.html">00924</a> <span class="keyword">struct </span><a class="code" href="structBarry_1_1Protocol_1_1Packet.html">Packet</a>
<a name="l00925"></a>00925 {
<a name="l00926"></a>00926         uint16_t        socket;         <span class="comment">// socket ID... 0 exists by default</span>
<a name="l00927"></a>00927         uint16_t        size;           <span class="comment">// total size of data packet</span>
<a name="l00928"></a>00928         uint8_t         command;
<a name="l00929"></a>00929 
<a name="l00930"></a><a class="code" href="unionBarry_1_1Protocol_1_1Packet_1_1PacketData.html">00930</a>         <span class="keyword">union </span><a class="code" href="unionBarry_1_1Protocol_1_1Packet_1_1PacketData.html">PacketData</a>
<a name="l00931"></a>00931         {
<a name="l00932"></a>00932 
<a name="l00933"></a>00933                 <a class="code" href="structBarry_1_1Protocol_1_1SocketCommand.html">SocketCommand</a>           socket;
<a name="l00934"></a>00934                 <a class="code" href="structBarry_1_1Protocol_1_1SequenceCommand.html">SequenceCommand</a>         sequence;
<a name="l00935"></a>00935                 <a class="code" href="structBarry_1_1Protocol_1_1DBAccess.html">DBAccess</a>                db;
<a name="l00936"></a>00936                 uint8_t                 raw[1];
<a name="l00937"></a>00937 
<a name="l00938"></a>00938         } __attribute__ ((packed)) u;
<a name="l00939"></a>00939 } __attribute__ ((packed));
<a name="l00940"></a>00940 <span class="preprocessor">#define SB_PACKET_HEADER_SIZE                   (sizeof(::Barry::Protocol::Packet) - sizeof(::Barry::Protocol::Packet::PacketData))</span>
<a name="l00941"></a>00941 <span class="preprocessor"></span>
<a name="l00942"></a>00942 <span class="comment">// WARNING : For JavaLoader we have some packet with 5 size !</span>
<a name="l00943"></a>00943 <span class="preprocessor">#define MIN_PACKET_SIZE                 5</span>
<a name="l00944"></a>00944 <span class="preprocessor"></span><span class="preprocessor">#define MIN_PACKET_DATA_SIZE            4</span>
<a name="l00945"></a>00945 <span class="preprocessor"></span>
<a name="l00946"></a>00946 
<a name="l00947"></a>00947 <span class="comment">// maximum sizes</span>
<a name="l00948"></a>00948 <span class="preprocessor">#define MAX_PACKET_SIZE                 0x400   // anything beyond this needs to be fragmented</span>
<a name="l00949"></a>00949 <span class="preprocessor"></span><span class="preprocessor">#define MAX_PACKET_DATA_SIZE            0x7FC   // for data packet (JavaLoader)</span>
<a name="l00950"></a>00950 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00951"></a>00951 <span class="comment">/////////////////////////////////////////////////////////////////////////////</span>
<a name="l00952"></a>00952 <span class="comment"></span><span class="comment">//</span>
<a name="l00953"></a>00953 <span class="comment">// various useful sizes</span>
<a name="l00954"></a>00954 <span class="comment">//</span>
<a name="l00955"></a>00955 
<a name="l00956"></a>00956 <span class="preprocessor">#define SB_PACKET_DBACCESS_HEADER_SIZE          (SB_PACKET_HEADER_SIZE + SB_DBACCESS_HEADER_SIZE)</span>
<a name="l00957"></a>00957 <span class="preprocessor"></span><span class="preprocessor">#define SB_FRAG_HEADER_SIZE                     SB_PACKET_DBACCESS_HEADER_SIZE</span>
<a name="l00958"></a>00958 <span class="preprocessor"></span>
<a name="l00959"></a>00959 <span class="preprocessor">#define SB_PACKET_COMMAND_HEADER_SIZE           (SB_PACKET_DBACCESS_HEADER_SIZE + DB_COMMAND_HEADER_SIZE)</span>
<a name="l00960"></a>00960 <span class="preprocessor"></span><span class="preprocessor">#define SB_PACKET_RESPONSE_HEADER_SIZE          (SB_PACKET_DBACCESS_HEADER_SIZE + DB_RESPONSE_HEADER_SIZE)</span>
<a name="l00961"></a>00961 <span class="preprocessor"></span>
<a name="l00962"></a>00962 <span class="preprocessor">#define SB_PACKET_DBDB_HEADER_SIZE              (SB_PACKET_RESPONSE_HEADER_SIZE + DBDB_RECORD_HEADER_SIZE)</span>
<a name="l00963"></a>00963 <span class="preprocessor"></span><span class="preprocessor">#define SB_PACKET_OLD_DBDB_HEADER_SIZE          (SB_PACKET_RESPONSE_HEADER_SIZE + OLD_DBDB_RECORD_HEADER_SIZE)</span>
<a name="l00964"></a>00964 <span class="preprocessor"></span>
<a name="l00965"></a>00965 <span class="preprocessor">#define SB_PACKET_UPLOAD_HEADER_SIZE            (SB_PACKET_DBACCESS_HEADER_SIZE + UPLOAD_HEADER_SIZE)</span>
<a name="l00966"></a>00966 <span class="preprocessor"></span>
<a name="l00967"></a>00967 <span class="preprocessor">#define SB_SEQUENCE_PACKET_SIZE                 (SB_PACKET_HEADER_SIZE + sizeof(::Barry::Protocol::SequenceCommand))</span>
<a name="l00968"></a>00968 <span class="preprocessor"></span><span class="preprocessor">#define SB_SOCKET_PACKET_HEADER_SIZE            (SB_PACKET_HEADER_SIZE + SOCKET_COMMAND_HEADER_SIZE)</span>
<a name="l00969"></a>00969 <span class="preprocessor"></span><span class="preprocessor">#define SB_MODE_PACKET_COMMAND_SIZE             (SB_SOCKET_PACKET_HEADER_SIZE + sizeof(::Barry::Protocol::ModeSelect) - sizeof(::Barry::Protocol::ModeSelect::ResponseBlock))</span>
<a name="l00970"></a>00970 <span class="preprocessor"></span><span class="preprocessor">#define SB_MODE_PACKET_RESPONSE_SIZE            (SB_SOCKET_PACKET_HEADER_SIZE + sizeof(::Barry::Protocol::ModeSelect))</span>
<a name="l00971"></a>00971 <span class="preprocessor"></span>
<a name="l00972"></a>00972 
<a name="l00973"></a>00973 <span class="comment">// Macros</span>
<a name="l00974"></a>00974 <span class="preprocessor">#define COMMAND(data)                           (((const ::Barry::Protocol::Packet *)data.GetData())-&gt;command)</span>
<a name="l00975"></a>00975 <span class="preprocessor"></span><span class="preprocessor">#define IS_COMMAND(data, cmd)                   (COMMAND(data) == cmd)</span>
<a name="l00976"></a>00976 <span class="preprocessor"></span><span class="preprocessor">#define MAKE_PACKET(var, data)                  const ::Barry::Protocol::Packet *var = (const ::Barry::Protocol::Packet *) (data).GetData()</span>
<a name="l00977"></a>00977 <span class="preprocessor"></span><span class="preprocessor">#define MAKE_JLPACKET(var, data)                const ::Barry::Protocol::JLPacket *var = (const ::Barry::Protocol::JLPacket *) (data).GetData()</span>
<a name="l00978"></a>00978 <span class="preprocessor"></span><span class="preprocessor">#define MAKE_JVMPACKET(var, data)               const ::Barry::Protocol::JVMPacket *var = (const ::Barry::Protocol::JVMPacket *) (data).GetData()</span>
<a name="l00979"></a>00979 <span class="preprocessor"></span><span class="preprocessor">#define MAKE_PACKETPTR_BUF(var, ptr)            ::Barry::Protocol::Packet *var = (::Barry::Protocol::Packet *)ptr</span>
<a name="l00980"></a>00980 <span class="preprocessor"></span><span class="preprocessor">#define MAKE_JLPACKETPTR_BUF(var, ptr)          ::Barry::Protocol::JLPacket *var = (::Barry::Protocol::JLPacket *)ptr</span>
<a name="l00981"></a>00981 <span class="preprocessor"></span><span class="preprocessor">#define MAKE_JVMPACKETPTR_BUF(var, ptr)         ::Barry::Protocol::JVMPacket *var = (::Barry::Protocol::JVMPacket *)ptr</span>
<a name="l00982"></a>00982 <span class="preprocessor"></span><span class="preprocessor">#define MAKE_RECORD(type,var,data,off)          type *var = (type *) ((data).GetData() + (off))</span>
<a name="l00983"></a>00983 <span class="preprocessor"></span><span class="preprocessor">#define MAKE_RECORD_PTR(type,var,data,off)      type *var = (type *) ((data) + (off))</span>
<a name="l00984"></a>00984 <span class="preprocessor"></span>
<a name="l00985"></a>00985 <span class="comment">// fragmentation protocol</span>
<a name="l00986"></a>00986 <span class="comment">// send DATA first, then keep sending DATA packets, FRAGMENTing</span>
<a name="l00987"></a>00987 <span class="comment">// as required until finished, then send DONE.  Both sides behave</span>
<a name="l00988"></a>00988 <span class="comment">// this way, so different sized data can be sent in both</span>
<a name="l00989"></a>00989 <span class="comment">// directions</span>
<a name="l00990"></a>00990 <span class="comment">//</span>
<a name="l00991"></a>00991 <span class="comment">// the fragmented piece only has a the param header, and then continues</span>
<a name="l00992"></a>00992 <span class="comment">// right on with the data</span>
<a name="l00993"></a>00993 
<a name="l00994"></a>00994 
<a name="l00995"></a>00995 
<a name="l00996"></a>00996 <span class="comment">// checks packet size and throws BError if not right</span>
<a name="l00997"></a>00997 <span class="keywordtype">void</span> CheckSize(<span class="keyword">const</span> <a class="code" href="classBarry_1_1Data.html">Barry::Data</a> &amp;packet, <span class="keywordtype">size_t</span> requiredsize);
<a name="l00998"></a>00998 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GetSize(<span class="keyword">const</span> <a class="code" href="classBarry_1_1Data.html">Barry::Data</a> &amp;packet);
<a name="l00999"></a>00999 
<a name="l01000"></a>01000 }} <span class="comment">// namespace Barry::Protocol</span>
<a name="l01001"></a>01001 
<a name="l01002"></a>01002 <span class="preprocessor">#endif</span>
<a name="l01003"></a>01003 <span class="preprocessor"></span>
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address>
</body>
</html>