Editing the structure of the devices.xml file - cristianoborgescardoso/nrf52 GitHub Wiki

Introduction

This article is about how to edit the structure of the device.xml file. That means, not just add a new device description, because it is already described on How to add new sensor description, but this is about how to add a new field or rearrange the actual structure of the devices.xml file

To perform this:

  1. Opening the project on NetBeansIDE
  2. Editing the devices.xml file
  3. Rebuild the project.

Opening the project on NetBeansIDE

The NetBeans 8.2 with SDK8 can be downloaded by: jdk-8u111-nb-8_2-windows-x64

To open the project on NetBeans go to menu: File>Open Project, as shown below:

octocat

Then Open the file:

octocat

Editing the devices.xml file

To edit the devices.xml, follow the instructions described on How to add new sensor description.

Generating Java classes from the devices.xml file

After editing the devices.xml, you need to generate new Java classes that will the same structure mapped from the XML file.

To do it just run the scriptgenerateNewJavaClasses.sh

./generateNewJavaClasses.sh

This script will

  1. Generate a new xsd file from the XML file
  2. Generate new Java classes from the xsd file
  3. Override the toString method in the DeviceXml.java class. This is necessary because the object DeviceXml is added to the combobox and the toString method defines wich String will be displayed in the comobox label.
  4. Copy the new classes to the source path of the project.

Editing the project on NetBeansIDE

Performing the previous steps, it means, changing the xml structure, generating new Java files and copping them to the src, will result in a collateral effect, the project will no longer work. Some editing in the source code will be necessary if you want an overview about the project feel free to contact me at [email protected].

Generating a new release version

  1. Open the project UICRFillerTool on NetBeans8.2;
  2. In left side, browse through the Files tab;
  3. Right-click in on 'build.xml' file.
  4. Select RunTarget>Other Targets>package-for-release. As shown in the image below:

octocat

Performing the previous steeps sucessfully a new UICRFillerTool.jar will be created on the release folder.

To know how to use the UICRFillerTool go to: UICRFillerTool