<?xml version="1.0" encoding="UTF-8"?>

<section xml:id="guiProgram"
         xmlns="http://docbook.org/ns/docbook" 
         xmlns:xlink="http://www.w3.org/1999/xlink">

<info>
  <title>Programming the radio</title>
</info>
  
<para>
  Once the <glossterm>Codeplug</glossterm> is finished, it can be programmed onto the radio. Just select the
  <guibutton>Write Codplug</guibutton> button in the tool-bar at the top of the window or select
  <guimenuitem>Write</guimenuitem> from the <guimenu>Device</guimenu> menu.
</para>

<para>
  In a first step, <application>qdmr</application> will try to detect a connected radio. Once a 
  radio is  found it will verify the codeplug with that radio. That is, it will check whether any 
  limits are  exceeded. For example the number of channels, contacts, group lists, etc. 
</para>

<para>
  There are several levels of issues that can be detected when verifying a codeplug with a radio. 
  The lowest level is the <guilabel>Information</guilabel>. These are just messages generated to inform 
  you about minor changes made to the codeplug to fit it into the specific radio. For example when 
  zones are split. These information are usually ignored and <application>qdmr</application> will 
  proceed writing the codeplug. 
</para>

<para>
  <guilabel>Warnings</guilabel> are one level more severe. They are issued if changes are made that 
  may change the behavior of the codeplug. The result, however, will still be a working codeplug. They are 
  usually issued when names are too long. When warnings are issued, <application>qdmr</application>
  will not automatically proceed writing the codeplug. The user, however, can ignore the warnings and 
  continue. In the application settings (see <xref linkend="guiSettingsDialog"/>), 
  you may choose to always ignore verification warnings. In this case, 
  <application>qdmr</application> will write the codeplug automatically, even if there were 
  some warnings.
</para>

<para>
  Finally <guilabel>Errors</guilabel> are the most severe verification issues. They simply prevent 
  writing the codeplug to the device. The user cannot ignore errors as they would result in 
  invalid and even damaging codeplugs being written to the device.
</para>

<para>
  If, however, everything fits into the radio, <application>qdmr</application> will start writing 
  the binary codeplug to the device.
</para>

<para>
  Writing the codeplug is a two-step process. First, the current codeplug is read from the
  radio. This includes all settings. Then the device-specific codeplug is updated and then
  re-uploaded to the device. This two-step process will maintain all device-specific settings made
  earlier unless explicitly set within qdmr.
</para>

<para>
  During the reading or writing, the <application>qdmr</application> GUI will turn gray (inactive) to
  prevent any changes to the codeplug during the transfer. However, a progress-bar is shown in the
  bottom-right to indicate the progress.
</para>


<section>
<info>
  <title>Permissions</title>
</info>

<para>
  When running <application>qdmr</application> or <command>dmrconf</command> under Linux, you may 
  need to change the permissions to access USB devices. Along with the software, a 
  <command>udev</command> rules file was installed. This file specifies that members of the 
  <systemitem class="groupname">dialout</systemitem> group have access to the radios. Consequently, 
  you need to be a member of this group. 
</para>

<para>
  You can check your group membership with <command>groups</command>. This command lists all groups 
  your user is a member of. This list should contain <systemitem class="groupname">dialout</systemitem>. 
</para>

<para>
  If your user is not yet a member of the <systemitem class="groupname">dialout</systemitem> group,
  you can add your user to it by calling
</para>
<screen>
  sudo adduser YOUR_USER dialout
</screen>
</section>

</section>
