Eclipse.org Eclipse.org - Device Kit

Creating a Global Positioning System (GPS) device

Use the instructions in this section to create a Global Positioning System (GPS) device using the Device Wizard.

  1. Open WebSphere Studio Device Developer.
  2. Change to the Plug-in perspective by clicking the Open a Perspective button on the right side of the WebSphere Studio Device Developer interface.
  3. Create a new project by clicking the Open the New Wizard button

    on the right side of the interface.

  4. Open the Device wizard by selecting Device Kit in the left pane and by selecting Device in the right pane on the New panel. Then click Next.
  5. Complete the fields in the Device Wizard panel and select Create test project if you want to generate a test project.
  6. Click Finish to create the device.

    After you create a new device using the wizard, there should be at least one new project in your workspace. The name of this project is the name that was entered for Device Name followed by ""Device"" (The remainder of this chapter will refer to this project as GpsNmeaDevice.) The GpsNmeaDevice project contains two source folders: GpsNmeaDevice and GpsNmeaDeviceDevelopment. If you selected Create Test Project, you will also have a project named GpsNmeaDeviceTest. Like the GpsNmeaDevice project, this project contains two source folders: GpsNmeaDeviceTest and GpsDeviceTestDevelopment.


    Table 4. GpsNmeaDevice Source Folders


    Folder name Description
    GpsNmeaDevice Contains the generated Java files. Initially, three packages and three classes are generated in addition to the following bundle-related files:
    Note:
    Some of the file names in this table display on more than one line because of the width of the page.
    • org.eclipse.soda.dk.gps.nmea.device.GpsNmeaDevice:  
      This class implements the transport service and provides the controls for the GpsNmeaDevice device.
    • org.eclipse.soda.dk.gps.nmea.device.bundle.  
      GpsNmeaDeviceBundleActivator:  
      This class is an OSGi bundle activator for GpsNmeaDevice device.
    • org.eclipse.soda.dk.gps.nmea.device.  
      service.GpsNmeaDeviceService:  
      This class defines the OSGi service to be registered for the GpsNmeaDevice device.
    • Meta-Inf:  
      This folder contains the OSGi manifest file, MANIFEST.MF.
    GpsNmeaDeviceDevelopment Contains the generated cml file that defines the properties for the device.

    Table 5. GpsNmeaDeviceTest Source Folders


    Folder name Description
    GpsNmeaDeviceTest Contains the generated Java files. Initially, three packages and three classes are generated in addition to the following bundle-related files:
    Note:
    Some of the file names in this table display on more than one line because of the width of the page.
    • org.eclipse.soda.dk.gps.nmea.device.  
      test.GpsNmeaDeviceTest:  
      This class is a template for GpsNmeaDeviceTest
    • org.eclipse.soda.dk.gps.nmea.transport.test.  
      bundle.GpsNmeaDeviceTestBundleActivator:  
      This class is an OSGi bundle activator for GpsNmeaDeviceTest.
    • org.eclipse.soda.dk.gps.nmea.test.service.  
      GpsNmeaDeviceTestService:  
      This class defines the OSGi service to be registered for the GpsNmeaDeviceTest.
    • Meta-Inf:  
      This folder contains the OSGi manifest file, MANIFEST.MF.
    GpsNmeaDeviceDevelopment Contains the generated cml file that defines the properties for the device.
  7. After you make changes to the cml file, you can regenerate the Java source to include the changes. To regenerate, right- click the cml file, select Device Kit, and then select Generate.

    The device will be regenerated so that it is consistent with the changes made in the cml file. In addition, regenerating the device preserves any custom code that was placed into the transport before the device was regenerated.