Sophie

Sophie

distrib > * > cooker > x86_64 > by-pkgid > 12036146830596fff8a6e80859ec761e > files > 69

lib64njb-devel-2.2.6-9.x86_64.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>libnjb: The basic device management and information API</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.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">libnjb&#160;<span id="projectnumber">2.2.6</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<h1>The basic device management and information API</h1>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga199efd7711a70ae5d63f4052c2e492d3">NJB_Discover</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njbs, int limit, int *n)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#gaa631536b597d8f8cb73eeb47eff6640a">NJB_Open</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga13a9c926c430f38f3a6535ecaaf3e9b9">NJB_Close</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga023eb258743b5961ec1b85cbd62a55cb">NJB_Capture</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga69d4034384f1bd033ed2c9ba7a9b32d4">NJB_Release</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga14869c6979a66b0aa0e6d35081bb2fc9">NJB_Ping</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#gab45cd3177a295ea8604423080e7e62ed">NJB_Get_Disk_Usage</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, u_int64_t *btotal, u_int64_t *bfree)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#gadca7f2a175da4e25244e81a5abafad7d">NJB_Get_Owner_String</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#gac24779b3f78bf1290d09a2b80db49a3d">NJB_Set_Owner_String</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, const char *name)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga0e4e3d0cfec6d9cc16c5b64eb89299b3">NJB_Get_Bitmap_Dimensions</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, int *x, int *y, int *bytes)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#gae5871d21d0a4c8e0c9984ffcd47c01ca">NJB_Set_Bitmap</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, const unsigned char *bitmap)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structnjb__keyval__struct.html">njb_keyval_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#gaeb93aded391e59cd53d6619a5c4e0151">NJB_Get_Keys</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">u_int64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga3bd68306e995f6775e605906b90dc5aa">NJB_Get_NJB1_Libcounter</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga5d9a7922425646d198ac81692e8e99ce">NJB_Send_Firmware</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, const char *path, <a class="el" href="libnjb_8h.html#a6efb672d692e39f52eb3589fde051ad2">NJB_Xfer_Callback</a> *callback, void *data)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga9e284653140092c2fe42fbb20e73265d">NJB_Get_Battery_Level</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#gaa5b633ed905de58a13b5682fa14c5113">NJB_Get_Battery_Charging</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga9f03a2404de7dfd084adea3c68fdb0f9">NJB_Get_Auxpower</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga9f6e12f2966bdf474c4db45af850fffd">NJB_Get_SDMI_ID</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, u_int8_t *sdmiid)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga0a3239069cd6e87ec14abee9c4d06b59">NJB_Get_Device_Name</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, int type)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga7016704848a564e396f2b2439f21f0df">NJB_Get_Firmware_Revision</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, u_int8_t *major, u_int8_t *minor, u_int8_t *release)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga6f4161a855d8a067a2c83de13b826b0f">NJB_Get_Hardware_Revision</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, u_int8_t *major, u_int8_t *minor, u_int8_t *release)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#gac531d9e84cfad1adb1df7947f65a4c3f">NJB_Set_Turbo_Mode</a> (<a class="el" href="structnjb__struct.html">njb_t</a> *njb, u_int8_t mode)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga023eb258743b5961ec1b85cbd62a55cb"></a><!-- doxytag: member="libnjb.h::NJB_Capture" ref="ga023eb258743b5961ec1b85cbd62a55cb" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Capture </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This captures a device for usage after opening.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to capture </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cursesplay_8c-example.html#a6">cursesplay.c</a>, <a class="el" href="delfile_8c-example.html#a6">delfile.c</a>, <a class="el" href="deltr_8c-example.html#a6">deltr.c</a>, <a class="el" href="dumpeax_8c-example.html#a7">dumpeax.c</a>, <a class="el" href="dumptime_8c-example.html#a7">dumptime.c</a>, <a class="el" href="files_8c-example.html#a14">files.c</a>, <a class="el" href="fwupgrade_8c-example.html#a8">fwupgrade.c</a>, <a class="el" href="getfile_8c-example.html#a6">getfile.c</a>, <a class="el" href="gettr_8c-example.html#a6">gettr.c</a>, <a class="el" href="pl_8c-example.html#a21">pl.c</a>, <a class="el" href="play_8c-example.html#a6">play.c</a>, <a class="el" href="playlists_8c-example.html#a17">playlists.c</a>, <a class="el" href="sendfile_8c-example.html#a8">sendfile.c</a>, <a class="el" href="sendtr_8c-example.html#a10">sendtr.c</a>, <a class="el" href="setpbm_8c-example.html#a6">setpbm.c</a>, <a class="el" href="settime_8c-example.html#a14">settime.c</a>, <a class="el" href="tagtr_8c-example.html#a10">tagtr.c</a>, and <a class="el" href="tracks_8c-example.html#a22">tracks.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="group__errors.html#gaa77a4904813cac57221afb5a0374d91c">EO_BADCOUNT</a>, <a class="el" href="protocol_8c.html#aded817a86b7cee20247ebae531626574">njb_capture()</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, <a class="el" href="protocol_8c.html#ad4c55baa3faa179396f2f76ce9fbd5ca">njb_get_library_counter()</a>, and <a class="el" href="structnjb__struct.html#a9c34c2b8e18cdf2c494f2cfe2e1e4f5f">njb_struct::protocol_state</a>.</p>

</div>
</div>
<a class="anchor" id="ga13a9c926c430f38f3a6535ecaaf3e9b9"></a><!-- doxytag: member="libnjb.h::NJB_Close" ref="ga13a9c926c430f38f3a6535ecaaf3e9b9" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void NJB_Close </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This closes a previously opened and used NJB object.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to close. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cursesplay_8c-example.html#a15">cursesplay.c</a>, <a class="el" href="delfile_8c-example.html#a9">delfile.c</a>, <a class="el" href="deltr_8c-example.html#a9">deltr.c</a>, <a class="el" href="dumpeax_8c-example.html#a21">dumpeax.c</a>, <a class="el" href="dumptime_8c-example.html#a19">dumptime.c</a>, <a class="el" href="files_8c-example.html#a20">files.c</a>, <a class="el" href="fwupgrade_8c-example.html#a11">fwupgrade.c</a>, <a class="el" href="getfile_8c-example.html#a14">getfile.c</a>, <a class="el" href="getowner_8c-example.html#a9">getowner.c</a>, <a class="el" href="gettr_8c-example.html#a20">gettr.c</a>, <a class="el" href="getusage_8c-example.html#a7">getusage.c</a>, <a class="el" href="handshake_8c-example.html#a23">handshake.c</a>, <a class="el" href="pl_8c-example.html#a28">pl.c</a>, <a class="el" href="play_8c-example.html#a12">play.c</a>, <a class="el" href="playlists_8c-example.html#a22">playlists.c</a>, <a class="el" href="sendfile_8c-example.html#a11">sendfile.c</a>, <a class="el" href="sendtr_8c-example.html#a17">sendtr.c</a>, <a class="el" href="setowner_8c-example.html#a10">setowner.c</a>, <a class="el" href="setpbm_8c-example.html#a10">setpbm.c</a>, <a class="el" href="settime_8c-example.html#a19">settime.c</a>, and <a class="el" href="tracks_8c-example.html#a29">tracks.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="protocol3_8c.html#a6cb6360d563df97d2ee763389ca94343">njb3_destroy_state()</a>, <a class="el" href="base_8c.html#ae7a3017562ff53c08d528260511e0456">njb_close()</a>, <a class="el" href="group__njbboxes.html#ga926fee67d4ce21c76387fc3776d8300a">NJB_DEVICE_NJB3</a>, and <a class="el" href="group__njbboxes.html#gaf6a2f938dac789dbe60fd180b3e349b9">NJB_DEVICE_NJBZEN</a>.</p>

</div>
</div>
<a class="anchor" id="ga199efd7711a70ae5d63f4052c2e492d3"></a><!-- doxytag: member="libnjb.h::NJB_Discover" ref="ga199efd7711a70ae5d63f4052c2e492d3" args="(njb_t *njbs, int limit, int *n)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Discover </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njbs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>limit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>n</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This scans the USB buses for available devices, i.e. jukeboxes.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njbs</td><td>a pointer to an array of <code>njb_t</code> objects that can be used for storing up to <code>limit</code> objects. </td></tr>
    <tr><td class="paramname">limit</td><td>the maximum number of <code>njb_t</code> device objects to retrieve (currently unused). </td></tr>
    <tr><td class="paramname">n</td><td>a pointer to a variable that will hold the number of objects actually retrieved. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cursesplay_8c-example.html#a3">cursesplay.c</a>, <a class="el" href="delfile_8c-example.html#a3">delfile.c</a>, <a class="el" href="deltr_8c-example.html#a3">deltr.c</a>, <a class="el" href="dumpeax_8c-example.html#a4">dumpeax.c</a>, <a class="el" href="dumptime_8c-example.html#a4">dumptime.c</a>, <a class="el" href="files_8c-example.html#a11">files.c</a>, <a class="el" href="fwupgrade_8c-example.html#a5">fwupgrade.c</a>, <a class="el" href="getfile_8c-example.html#a3">getfile.c</a>, <a class="el" href="getowner_8c-example.html#a5">getowner.c</a>, <a class="el" href="gettr_8c-example.html#a3">gettr.c</a>, <a class="el" href="getusage_8c-example.html#a3">getusage.c</a>, <a class="el" href="handshake_8c-example.html#a3">handshake.c</a>, <a class="el" href="pl_8c-example.html#a18">pl.c</a>, <a class="el" href="play_8c-example.html#a3">play.c</a>, <a class="el" href="playlists_8c-example.html#a14">playlists.c</a>, <a class="el" href="sendfile_8c-example.html#a5">sendfile.c</a>, <a class="el" href="sendtr_8c-example.html#a7">sendtr.c</a>, <a class="el" href="setowner_8c-example.html#a5">setowner.c</a>, <a class="el" href="setpbm_8c-example.html#a3">setpbm.c</a>, <a class="el" href="settime_8c-example.html#a11">settime.c</a>, <a class="el" href="tagtr_8c-example.html#a7">tagtr.c</a>, and <a class="el" href="tracks_8c-example.html#a19">tracks.c</a>.</dd>
</dl>
<p>References <a class="el" href="base_8c.html#aa4e733ca216b5018fc0be303a080d0f2">njb_discover()</a>.</p>

</div>
</div>
<a class="anchor" id="ga9f03a2404de7dfd084adea3c68fdb0f9"></a><!-- doxytag: member="libnjb.h::NJB_Get_Auxpower" ref="ga9f03a2404de7dfd084adea3c68fdb0f9" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Get_Auxpower </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function determines if we are on auxiliary power (charger connected) or not. (It will also signify if the USB power is connected on devices that support it.) One most typical use of this function is to determine the status before any firmware upgrade commence.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to get the auxiliary power status for. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>1 if we are connected to auxiliary power, 0 if we're not, and -1 if the call failed. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="handshake_8c-example.html#a15">handshake.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="protocol3_8c.html#a01ddb94dde9f1369519cea9159947291">njb3_power_status()</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, <a class="el" href="group__basic.html#ga14869c6979a66b0aa0e6d35081bb2fc9">NJB_Ping()</a>, <a class="el" href="structnjb__state__t.html#ac1237d7c88781a7b366e8ba4a1c507d2">njb_state_t::power</a>, and <a class="el" href="structnjb__struct.html#a9c34c2b8e18cdf2c494f2cfe2e1e4f5f">njb_struct::protocol_state</a>.</p>

</div>
</div>
<a class="anchor" id="gaa5b633ed905de58a13b5682fa14c5113"></a><!-- doxytag: member="libnjb.h::NJB_Get_Battery_Charging" ref="gaa5b633ed905de58a13b5682fa14c5113" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Get_Battery_Charging </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function determines if we are charging the battery or not.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to get the charging status for. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>1 if we are charging, 0 if we're not charging, and -1 if the call failed. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="handshake_8c-example.html#a16">handshake.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="protocol3_8c.html#a01ddb94dde9f1369519cea9159947291">njb3_power_status()</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, <a class="el" href="group__basic.html#ga14869c6979a66b0aa0e6d35081bb2fc9">NJB_Ping()</a>, <a class="el" href="structnjb__state__t.html#ac1237d7c88781a7b366e8ba4a1c507d2">njb_state_t::power</a>, and <a class="el" href="structnjb__struct.html#a9c34c2b8e18cdf2c494f2cfe2e1e4f5f">njb_struct::protocol_state</a>.</p>

</div>
</div>
<a class="anchor" id="ga9e284653140092c2fe42fbb20e73265d"></a><!-- doxytag: member="libnjb.h::NJB_Get_Battery_Level" ref="ga9e284653140092c2fe42fbb20e73265d" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Get_Battery_Level </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function returns the current battery level between 0 and 100. The hardware will typically prevent the device from working properly if the battery level is too low, so figures above 50 are the most common.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to get the battery level for. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the battery level between 0 and 100, or -1 if the function call fails. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="handshake_8c-example.html#a17">handshake.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="protocol3_8c.html#a01ddb94dde9f1369519cea9159947291">njb3_power_status()</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, <a class="el" href="group__basic.html#ga14869c6979a66b0aa0e6d35081bb2fc9">NJB_Ping()</a>, <a class="el" href="structnjb__state__t.html#ac1237d7c88781a7b366e8ba4a1c507d2">njb_state_t::power</a>, and <a class="el" href="structnjb__struct.html#a9c34c2b8e18cdf2c494f2cfe2e1e4f5f">njb_struct::protocol_state</a>.</p>

</div>
</div>
<a class="anchor" id="ga0e4e3d0cfec6d9cc16c5b64eb89299b3"></a><!-- doxytag: member="libnjb.h::NJB_Get_Bitmap_Dimensions" ref="ga0e4e3d0cfec6d9cc16c5b64eb89299b3" args="(njb_t *njb, int *x, int *y, int *bytes)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Get_Bitmap_Dimensions </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>bytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p><b>EXPERIMENTAL:</b> This function returns the dimensions for the bitmap image on the device, in case the bitmap can be set. Returns -1 if the device does not support setting the bitmap. Currently this command only supports sending bitmap to the NJB2, other models are unsupported, so this needs some development.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the jukebox object to use </td></tr>
    <tr><td class="paramname">x</td><td>Number of pixels on the X axis </td></tr>
    <tr><td class="paramname">y</td><td>Number of pixels on the Y axis </td></tr>
    <tr><td class="paramname">bytes</td><td>number of bytes for the entire bitmap image </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 if setting bitmap is not possible </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__basic.html#gae5871d21d0a4c8e0c9984ffcd47c01ca">NJB_Set_Bitmap()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="setpbm_8c-example.html#a7">setpbm.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="structnjb3__state__t.html#ae68cb8235ab1d125bd5c47d4bb3c02b4">njb3_state_t::fwMajor</a>, <a class="el" href="structnjb3__state__t.html#ac7ac5bf4b8514b0c198a6cc272a3e34e">njb3_state_t::fwMinor</a>, <a class="el" href="structnjb3__state__t.html#ac3aaedbd330c61123f71d84c09f70c3e">njb3_state_t::fwRel</a>, <a class="el" href="group__njbboxes.html#ga09633bbeb6f8f6ea9d3ca22cdfe2bce6">NJB_DEVICE_NJB2</a>, <a class="el" href="group__njbboxes.html#ga926fee67d4ce21c76387fc3776d8300a">NJB_DEVICE_NJB3</a>, <a class="el" href="group__njbboxes.html#gaf6a2f938dac789dbe60fd180b3e349b9">NJB_DEVICE_NJBZEN</a>, <a class="el" href="group__njbboxes.html#gab71524f64ef1bd8ce5b5d2c43e0e96ed">NJB_DEVICE_NJBZEN2</a>, <a class="el" href="group__njbboxes.html#gabdcfd9cceb42cc2eb36b5bdec8e6fb99">NJB_DEVICE_NJBZENNX</a>, <a class="el" href="group__njbboxes.html#ga672923cbac0535dd462b3301a8db7d36">NJB_DEVICE_NJBZENTOUCH</a>, <a class="el" href="group__njbboxes.html#ga740111e4a5ce05f1de2514ef009950fa">NJB_DEVICE_NJBZENXTRA</a>, and <a class="el" href="structnjb__struct.html#a9c34c2b8e18cdf2c494f2cfe2e1e4f5f">njb_struct::protocol_state</a>.</p>

<p>Referenced by <a class="el" href="group__basic.html#gae5871d21d0a4c8e0c9984ffcd47c01ca">NJB_Set_Bitmap()</a>.</p>

</div>
</div>
<a class="anchor" id="ga0a3239069cd6e87ec14abee9c4d06b59"></a><!-- doxytag: member="libnjb.h::NJB_Get_Device_Name" ref="ga0a3239069cd6e87ec14abee9c4d06b59" args="(njb_t *njb, int type)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* NJB_Get_Device_Name </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function returns the name of the jukebox device as a string.</p>
<pre>
 char *name;
 name = NJB_Get_Device_Name(njb, 0);
 if (name != NULL) {
   printf("Device name: %s\n", name);
 }
 </pre><dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to get the device name for. </td></tr>
    <tr><td class="paramname">type</td><td>decides whether libnjb should decide what kind of device this is, or if the string from the device itself should be used. 0 = use libnjb detection (based on USB device IDs), 1 = get the string from the device itself. If you set this to type 1, you must first call <code><a class="el" href="group__basic.html#gaa631536b597d8f8cb73eeb47eff6640a">NJB_Open()</a></code> on the <code>njb_t</code> object pointer, so this is not suitable when you want to display a selection list of available devices prior to opening one of them. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a pointer to a string that contains the device name string after a call to this function. The string <b>must not</b> be freed by the caller, because this is a pointer into a string holder inside libnjb! On error, NULL will be returned. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="handshake_8c-example.html#a7">handshake.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, <a class="el" href="base_8c.html#a8204c8f74fd8a8e5069f4239f3b10e0a">njb_get_usb_device_name()</a>, <a class="el" href="structnjb3__state__t.html#a0344b9c490856a3f76cd4aa859e0375f">njb3_state_t::product_name</a>, <a class="el" href="structnjb__state__t.html#a8a05f4170dcadb42b8b7771be85a544a">njb_state_t::productName</a>, and <a class="el" href="structnjb__struct.html#a9c34c2b8e18cdf2c494f2cfe2e1e4f5f">njb_struct::protocol_state</a>.</p>

</div>
</div>
<a class="anchor" id="gab45cd3177a295ea8604423080e7e62ed"></a><!-- doxytag: member="libnjb.h::NJB_Get_Disk_Usage" ref="gab45cd3177a295ea8604423080e7e62ed" args="(njb_t *njb, u_int64_t *btotal, u_int64_t *bfree)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Get_Disk_Usage </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int64_t *&#160;</td>
          <td class="paramname"><em>btotal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int64_t *&#160;</td>
          <td class="paramname"><em>bfree</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This retrieves the amount of currently used disk space in bytes.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to get usage for </td></tr>
    <tr><td class="paramname">btotal</td><td>a pointer to a 64 bit integer that shall hold the number of total bytes on the device after the call </td></tr>
    <tr><td class="paramname">bfree</td><td>a pointer to a 64 bit integer that shall hold the number of free bytes on the device after the call </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="getusage_8c-example.html#a6">getusage.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, and <a class="el" href="protocol_8c.html#a7f0a8d1560f23483fe722fb51f634fe8">njb_get_disk_usage()</a>.</p>

<p>Referenced by <a class="el" href="group__tagapi.html#gade6296b1920788ae715e8d57d50a9e8a">NJB_Send_Track()</a>.</p>

</div>
</div>
<a class="anchor" id="ga7016704848a564e396f2b2439f21f0df"></a><!-- doxytag: member="libnjb.h::NJB_Get_Firmware_Revision" ref="ga7016704848a564e396f2b2439f21f0df" args="(njb_t *njb, u_int8_t *major, u_int8_t *minor, u_int8_t *release)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Get_Firmware_Revision </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int8_t *&#160;</td>
          <td class="paramname"><em>major</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int8_t *&#160;</td>
          <td class="paramname"><em>minor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int8_t *&#160;</td>
          <td class="paramname"><em>release</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function returns the firmware revision for a certain jukebox device. The <code>release</code> parameter will not be valid for the NJB1 since this only has two version numbers. Example usage:</p>
<pre>
 uint8 major;
 uint8 minor;
 uint8 release;</pre><pre> NJB_Get_Firmware_Revision(njb, &amp;major, &amp;minor, &amp;release);
 printf("Firmware revision: %d.%d.%d\n", major, minor, release);
 </pre><dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to get the firmware revision for. </td></tr>
    <tr><td class="paramname">major</td><td>will hold the major revision number for the firmware after the call, if the call was successful. </td></tr>
    <tr><td class="paramname">minor</td><td>will hold the minor revision number for the firmware after the call, if the call was successful. </td></tr>
    <tr><td class="paramname">release</td><td>will hold the release number for the firmware after the call, if the call was successful. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the call was successful, -1 on failure. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="handshake_8c-example.html#a12">handshake.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="structnjb3__state__t.html#ae68cb8235ab1d125bd5c47d4bb3c02b4">njb3_state_t::fwMajor</a>, <a class="el" href="structnjb__state__t.html#a8913dcd2ee685b21b3b8f623bdc84520">njb_state_t::fwMajor</a>, <a class="el" href="structnjb3__state__t.html#ac7ac5bf4b8514b0c198a6cc272a3e34e">njb3_state_t::fwMinor</a>, <a class="el" href="structnjb__state__t.html#a17451bea8bb539d6f91e25b527b1c3aa">njb_state_t::fwMinor</a>, <a class="el" href="structnjb3__state__t.html#ac3aaedbd330c61123f71d84c09f70c3e">njb3_state_t::fwRel</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, and <a class="el" href="structnjb__struct.html#a9c34c2b8e18cdf2c494f2cfe2e1e4f5f">njb_struct::protocol_state</a>.</p>

</div>
</div>
<a class="anchor" id="ga6f4161a855d8a067a2c83de13b826b0f"></a><!-- doxytag: member="libnjb.h::NJB_Get_Hardware_Revision" ref="ga6f4161a855d8a067a2c83de13b826b0f" args="(njb_t *njb, u_int8_t *major, u_int8_t *minor, u_int8_t *release)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Get_Hardware_Revision </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int8_t *&#160;</td>
          <td class="paramname"><em>major</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int8_t *&#160;</td>
          <td class="paramname"><em>minor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int8_t *&#160;</td>
          <td class="paramname"><em>release</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function returns the hardware revision for a certain jukebox device. This information is hardcoded to "1.0.0" for the NJB1 since that device does not support retrieving the hardware revision.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to get the hardware revision for. </td></tr>
    <tr><td class="paramname">major</td><td>will hold the major revision number for the hardware after the call, if the call was successful. </td></tr>
    <tr><td class="paramname">minor</td><td>will hold the minor revision number for the hardware after the call, if the call was successful. </td></tr>
    <tr><td class="paramname">release</td><td>will hold the release number for the hardware after the call, if the call was successful. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the call was successful, -1 on failure. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="handshake_8c-example.html#a14">handshake.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="structnjb3__state__t.html#a60e1db701cc6f1a3e6e6acbfb86ab26b">njb3_state_t::hwMajor</a>, <a class="el" href="structnjb3__state__t.html#a6492b0af17edf2b3f840c40d54df222c">njb3_state_t::hwMinor</a>, <a class="el" href="structnjb3__state__t.html#a861f0b8e9ff6cf19008fc0f21ba27b3a">njb3_state_t::hwRel</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, and <a class="el" href="structnjb__struct.html#a9c34c2b8e18cdf2c494f2cfe2e1e4f5f">njb_struct::protocol_state</a>.</p>

</div>
</div>
<a class="anchor" id="gaeb93aded391e59cd53d6619a5c4e0151"></a><!-- doxytag: member="libnjb.h::NJB_Get_Keys" ref="gaeb93aded391e59cd53d6619a5c4e0151" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structnjb__keyval__struct.html">njb_keyval_t</a>* NJB_Get_Keys </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>On series 3 devices, this command retrieves some key/value pairs that are believed to be used for DRM schemes. We have no idea of how to use these, just that they make possible to do proper signing of protected WMA files before transfer.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the jukebox object to get the keys from. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="handshake_8c-example.html#a18">handshake.c</a>.</dd>
</dl>
</div>
</div>
<a class="anchor" id="ga3bd68306e995f6775e605906b90dc5aa"></a><!-- doxytag: member="libnjb.h::NJB_Get_NJB1_Libcounter" ref="ga3bd68306e995f6775e605906b90dc5aa" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u_int64_t NJB_Get_NJB1_Libcounter </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This retrieves the library counter for the Nomad Jukebox 1 (D.A.P., the original). The library counter can be used to validate a track cache for this device, but not for any other devices. If you have a cache with all tracks, datafiles and playlists (in some self-defined format) you can store it along with this number when your program exits. When you restart your program you can check if the numbers are still the same, and if they are, you can keep using your old track/file/playlist cache and need not re-read that information.</p>
<p>Note that you have to take action to make sure that you do not accidentally lock out series 3 devices! If this function returns zero, always re-read the entire library.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the jukebox object to get the library counter from. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a library counter, if this is 0, the tracks, playlists and datafiles need to be re-read, i.e. the cached database is invalid. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="handshake_8c-example.html#a13">handshake.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, and <a class="el" href="structnjb__struct.html#a9c34c2b8e18cdf2c494f2cfe2e1e4f5f">njb_struct::protocol_state</a>.</p>

</div>
</div>
<a class="anchor" id="gadca7f2a175da4e25244e81a5abafad7d"></a><!-- doxytag: member="libnjb.h::NJB_Get_Owner_String" ref="gadca7f2a175da4e25244e81a5abafad7d" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* NJB_Get_Owner_String </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This retrieves the owner string for the device, a string representing the owners name.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to get the owner string for </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>a valid owner string or NULL on failure. The string is newly allocated on the heap and should be freed by the caller after use. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="getowner_8c-example.html#a8">getowner.c</a>, and <a class="el" href="setowner_8c-example.html#a9">setowner.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="group__errors.html#ga2ab3784c31667eb7bd6dbc4296818720">EO_NOMEM</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, <a class="el" href="group__unicodeflags.html#ga388e9c70b7a684c777f6b25e2e9d801b">NJB_UC_UTF8</a>, and <a class="el" href="unicode_8c.html#a4b1829345b6bf2af61d6dbbb1b02726b">strtoutf8()</a>.</p>

</div>
</div>
<a class="anchor" id="ga9f6e12f2966bdf474c4db45af850fffd"></a><!-- doxytag: member="libnjb.h::NJB_Get_SDMI_ID" ref="ga9f6e12f2966bdf474c4db45af850fffd" args="(njb_t *njb, u_int8_t *sdmiid)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Get_SDMI_ID </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int8_t *&#160;</td>
          <td class="paramname"><em>sdmiid</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function returns the unique SDMI ID of 16 bytes for a jukebox device. Example:</p>
<pre>
 u_int8_t sdmiid[16];
 int result;
 result = NJB_Get_SDMI_ID(njb, &amp;sdmiid);
 </pre><dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to get the SDMI ID for. </td></tr>
    <tr><td class="paramname">sdmiid</td><td>a pointer to a byte array of 16 bytes (declare this as <code>u_int8_t foo[16];</code>) that will hold the SDMI ID if the function completed successfully. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="handshake_8c-example.html#a9">handshake.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, <a class="el" href="structnjb__struct.html#a9c34c2b8e18cdf2c494f2cfe2e1e4f5f">njb_struct::protocol_state</a>, and <a class="el" href="structnjb__state__t.html#abc1703f019eda99b2a53714249b14ffc">njb_state_t::sdmiid</a>.</p>

</div>
</div>
<a class="anchor" id="gaa631536b597d8f8cb73eeb47eff6640a"></a><!-- doxytag: member="libnjb.h::NJB_Open" ref="gaa631536b597d8f8cb73eeb47eff6640a" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Open </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This opens a device for use. This routine will initialize the USB endpoints and interfaces, and allocate an error stack so that error reporting routines can be used after this call.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the NJB object to open </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cursesplay_8c-example.html#a4">cursesplay.c</a>, <a class="el" href="delfile_8c-example.html#a4">delfile.c</a>, <a class="el" href="deltr_8c-example.html#a4">deltr.c</a>, <a class="el" href="dumpeax_8c-example.html#a5">dumpeax.c</a>, <a class="el" href="dumptime_8c-example.html#a5">dumptime.c</a>, <a class="el" href="files_8c-example.html#a12">files.c</a>, <a class="el" href="fwupgrade_8c-example.html#a6">fwupgrade.c</a>, <a class="el" href="getfile_8c-example.html#a4">getfile.c</a>, <a class="el" href="getowner_8c-example.html#a6">getowner.c</a>, <a class="el" href="gettr_8c-example.html#a4">gettr.c</a>, <a class="el" href="getusage_8c-example.html#a4">getusage.c</a>, <a class="el" href="handshake_8c-example.html#a5">handshake.c</a>, <a class="el" href="pl_8c-example.html#a19">pl.c</a>, <a class="el" href="play_8c-example.html#a4">play.c</a>, <a class="el" href="playlists_8c-example.html#a15">playlists.c</a>, <a class="el" href="sendfile_8c-example.html#a6">sendfile.c</a>, <a class="el" href="sendtr_8c-example.html#a8">sendtr.c</a>, <a class="el" href="setowner_8c-example.html#a6">setowner.c</a>, <a class="el" href="setpbm_8c-example.html#a4">setpbm.c</a>, <a class="el" href="settime_8c-example.html#a12">settime.c</a>, <a class="el" href="tagtr_8c-example.html#a8">tagtr.c</a>, and <a class="el" href="tracks_8c-example.html#a20">tracks.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="protocol3_8c.html#a62e227f18d3a17362052f14a81031035">njb3_init_state()</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, <a class="el" href="group__njbboxes.html#ga926fee67d4ce21c76387fc3776d8300a">NJB_DEVICE_NJB3</a>, <a class="el" href="group__njbboxes.html#gaf6a2f938dac789dbe60fd180b3e349b9">NJB_DEVICE_NJBZEN</a>, <a class="el" href="procedure_8c.html#af77a8af68d57e51d6b7959d696954e07">NJB_Handshake()</a>, <a class="el" href="protocol_8c.html#a41a4352e7fba316a9eb6262546e05e4a">njb_init_state()</a>, and <a class="el" href="base_8c.html#aac86db6853a2e7b6345bf9544ff830a3">njb_open()</a>.</p>

</div>
</div>
<a class="anchor" id="ga14869c6979a66b0aa0e6d35081bb2fc9"></a><!-- doxytag: member="libnjb.h::NJB_Ping" ref="ga14869c6979a66b0aa0e6d35081bb2fc9" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void NJB_Ping </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This sends a ping ("are you there?") command to the device.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the jukebox object to ping. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="handshake_8c-example.html#a8">handshake.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, and <a class="el" href="protocol_8c.html#ae959b6717b8bd6b3bcd61447e8ddda17">njb_ping()</a>.</p>

<p>Referenced by <a class="el" href="group__basic.html#ga9f03a2404de7dfd084adea3c68fdb0f9">NJB_Get_Auxpower()</a>, <a class="el" href="group__basic.html#gaa5b633ed905de58a13b5682fa14c5113">NJB_Get_Battery_Charging()</a>, and <a class="el" href="group__basic.html#ga9e284653140092c2fe42fbb20e73265d">NJB_Get_Battery_Level()</a>.</p>

</div>
</div>
<a class="anchor" id="ga69d4034384f1bd033ed2c9ba7a9b32d4"></a><!-- doxytag: member="libnjb.h::NJB_Release" ref="ga69d4034384f1bd033ed2c9ba7a9b32d4" args="(njb_t *njb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Release </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This releases a captured NJB object after use.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to release </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="cursesplay_8c-example.html#a14">cursesplay.c</a>, <a class="el" href="delfile_8c-example.html#a8">delfile.c</a>, <a class="el" href="deltr_8c-example.html#a8">deltr.c</a>, <a class="el" href="dumpeax_8c-example.html#a20">dumpeax.c</a>, <a class="el" href="dumptime_8c-example.html#a18">dumptime.c</a>, <a class="el" href="files_8c-example.html#a19">files.c</a>, <a class="el" href="fwupgrade_8c-example.html#a10">fwupgrade.c</a>, <a class="el" href="getfile_8c-example.html#a13">getfile.c</a>, <a class="el" href="gettr_8c-example.html#a19">gettr.c</a>, <a class="el" href="pl_8c-example.html#a27">pl.c</a>, <a class="el" href="play_8c-example.html#a11">play.c</a>, <a class="el" href="playlists_8c-example.html#a21">playlists.c</a>, <a class="el" href="sendfile_8c-example.html#a10">sendfile.c</a>, <a class="el" href="sendtr_8c-example.html#a16">sendtr.c</a>, <a class="el" href="setpbm_8c-example.html#a9">setpbm.c</a>, <a class="el" href="settime_8c-example.html#a18">settime.c</a>, <a class="el" href="tagtr_8c-example.html#a16">tagtr.c</a>, and <a class="el" href="tracks_8c-example.html#a28">tracks.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="protocol_8c.html#aded817a86b7cee20247ebae531626574">njb_capture()</a>, and <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>.</p>

</div>
</div>
<a class="anchor" id="ga5d9a7922425646d198ac81692e8e99ce"></a><!-- doxytag: member="libnjb.h::NJB_Send_Firmware" ref="ga5d9a7922425646d198ac81692e8e99ce" args="(njb_t *njb, const char *path, NJB_Xfer_Callback *callback, void *data)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Send_Firmware </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="libnjb_8h.html#a6efb672d692e39f52eb3589fde051ad2">NJB_Xfer_Callback</a> *&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p><b>EXPERIMENTAL:</b> This function sends a new firmware to the device.</p>
<p>DO NOT TRY OR USE THIS FUNCTION UNLESS YOU ARE 100 PERCENT SURE OF WHAT YOU ARE DOING, IT IS VITALLY DANGEROUS TO YOUR DEVICE AND MAY RENDER IT COMPLETELY USELESS IF USED WITH INVALID DATA.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to send the file to </td></tr>
    <tr><td class="paramname">path</td><td>a path to the firmware file that shall be downloaded. This file must be the <em>raw firmware chunks</em> as sent across the USB bus to the device. </td></tr>
    <tr><td class="paramname">callback</td><td>a function that will be called repeatedly to report progress during transfer, used for e.g. displaying progress bars. This may be NULL if you don't like callbacks. </td></tr>
    <tr><td class="paramname">data</td><td>a voluntary parameter that can associate some user-supplied data with each callback call. It is OK to set this to NULL of course. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="fwupgrade_8c-example.html#a9">fwupgrade.c</a>.</dd>
</dl>
<p>References <a class="el" href="procedure_8c.html#ad7ebab46fa81c69bd52ccc715f183d2e">_file_size()</a>, <a class="el" href="group__errors.html#ga909b3766a05c3f22ba04e40a39efa581">EO_INVALID</a>, <a class="el" href="group__errors.html#gaccdcb6efe55a82e46b2a702edcc85781">EO_SRCFILE</a>, <a class="el" href="protocol3_8c.html#aea0edf60a976fbe68c0fd3e0aae10984">njb3_announce_firmware()</a>, and <a class="el" href="protocol3_8c.html#a11c183e62511af9c23f15e5f1d7a1912">njb3_get_firmware_confirmation()</a>.</p>

</div>
</div>
<a class="anchor" id="gae5871d21d0a4c8e0c9984ffcd47c01ca"></a><!-- doxytag: member="libnjb.h::NJB_Set_Bitmap" ref="gae5871d21d0a4c8e0c9984ffcd47c01ca" args="(njb_t *njb, const unsigned char *bitmap)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Set_Bitmap </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>bitmap</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p><b>EXPERIMENTAL:</b> This sets the bitmap (boot-up logo) on the device. It is currently experimental and not all devices support changing the bitmap.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the jukebox object to use </td></tr>
    <tr><td class="paramname">bitmap</td><td>A raw bitmap image to send to the device. Note that this image shall have the dimensions indicated by a previous <a class="el" href="group__basic.html#ga0e4e3d0cfec6d9cc16c5b64eb89299b3">NJB_Get_Bitmap_Dimensions()</a> call. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__basic.html#ga0e4e3d0cfec6d9cc16c5b64eb89299b3">NJB_Get_Bitmap_Dimensions()</a> </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="setpbm_8c-example.html#a8">setpbm.c</a>.</dd>
</dl>
<p>References <a class="el" href="protocol3_8c.html#a22acc85e6102a1192c59c481d20b07aa">njb3_set_bitmap()</a>, and <a class="el" href="group__basic.html#ga0e4e3d0cfec6d9cc16c5b64eb89299b3">NJB_Get_Bitmap_Dimensions()</a>.</p>

</div>
</div>
<a class="anchor" id="gac24779b3f78bf1290d09a2b80db49a3d"></a><!-- doxytag: member="libnjb.h::NJB_Set_Owner_String" ref="gac24779b3f78bf1290d09a2b80db49a3d" args="(njb_t *njb, const char *name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Set_Owner_String </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This sets the owner string for the device, a string representing the owner.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to set the owner string for </td></tr>
    <tr><td class="paramname">name</td><td>the new owner string </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="setowner_8c-example.html#a8">setowner.c</a>.</dd>
</dl>
<p>References <a class="el" href="structnjb__struct.html#a405f9cb824196553362aa8d4ad546c07">njb_struct::device_type</a>, <a class="el" href="group__njbboxes.html#gad84011f40d11f1eae13f708cdc3c29fb">NJB_DEVICE_NJB1</a>, <a class="el" href="group__unicodeflags.html#ga388e9c70b7a684c777f6b25e2e9d801b">NJB_UC_UTF8</a>, <a class="el" href="protocol_8c.html#ae5ea9fbb3859ec50540bcd9cf4a3f328">njb_verify_last_command()</a>, <a class="el" href="libnjb_8h.html#a47636ef255d9c072bdbcabdb99a85914">OWNER_STRING_LENGTH</a>, and <a class="el" href="unicode_8c.html#a767008fdd0e78d87acbc7f1ad3bf4830">utf8tostr()</a>.</p>

</div>
</div>
<a class="anchor" id="gac531d9e84cfad1adb1df7947f65a4c3f"></a><!-- doxytag: member="libnjb.h::NJB_Set_Turbo_Mode" ref="gac531d9e84cfad1adb1df7947f65a4c3f" args="(njb_t *njb, u_int8_t mode)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int NJB_Set_Turbo_Mode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structnjb__struct.html">njb_t</a> *&#160;</td>
          <td class="paramname"><em>njb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u_int8_t&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>This function sets the turbo mode to on or off. The default value if the function is not called is that turbo is ON. We have found that a few (very few) devices will react badly on turbo mode, resulting in bad transfers. This setting is only applicable on the series 3 devices, it will have no effect on the NJB1. (Command available as of libnjb 2.2.4.)</p>
<p>Example usage: </p>
<pre>
 NJB_Set_Turbo_Mode(njb, NJB_TURBO_OFF);
 </pre><dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">njb</td><td>a pointer to the <code>njb_t</code> object to set the turbo mode for. </td></tr>
    <tr><td class="paramname">mode</td><td>the turbo mode. <code>NJB_TURBO_ON</code> or <code>NJB_TURBO_OFF</code>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0 if the call was successful, -1 on failure. </dd></dl>

<p>References <a class="el" href="structnjb__struct.html#a9c34c2b8e18cdf2c494f2cfe2e1e4f5f">njb_struct::protocol_state</a>, and <a class="el" href="structnjb3__state__t.html#a86ba6395f4d2a8f171cc6251ace4b9e1">njb3_state_t::turbo_mode</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Mon May 2 2011 06:05:24 for libnjb by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>