Eclipse.org Eclipse.org - Device Kit

Creating a transport for your Global Positioning System (GPS) device

Use the following steps to create a transport for your Global Positioning System (GPS) device:

  1. Create a new project by clicking the Open the New Wizard button

    on the right side of the interface.

  2. Open the Transport wizard by selecting Device Kit in the left pane and by selecting Transport in the right pane on the New panel. Then click Next.
  3. Complete the fields in the Transport Wizard panel and select Create test project if you want to generate a test project.
  4. Click Next.
  5. If a default connection was selected, enter the connection values for that connection.
  6. Click Finish.

    After you create a new transport 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 Transport Name followed by ""Transport"" (The remainder of this chapter will refer to this project as GpsNmeaTransport.) The GpsNmeaTransport project contains two source folders: GpsNmeaTransport and GpsNmeaTransportDevelopment. If you selected Create Test Project, you will also have a project called GpsNmeaTransportTest. Like the GpsNmeaTransport project, this project contains two source folders: GpsNmeaTransportTest and GpsTransportTestDevelopment.


    Table 6. GpsNmeaTransport Source Folders


    Folder name Description
    GpsNmeaTransport 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.transport.GpsNmeaTransport:  
      This class implements the transport service and provides the controls for the GpsNmeaTransport transport.
    • org.eclipse.soda.dk.gps.nmea.transport.bundle.  
      GpsNmeaTransportBundleActivator:  
      This class is an OSGi bundle activator for GpsNmeaTransport transport.
    • org.eclipse.soda.dk.gps.nmea.transport.service.   
      GpsNmeaTransportService:  
      This class defines the OSGi service to be registered for the GpsNmeaTransport transport.
    • Meta-Inf:  
      This folder contains the OSGi manifest file, MANIFEST.MF.
    GpsNmeaTransportDevelopment Contains the generated cml file that defines the properties for the transport test.

    Table 7. GpsNmeaTransportTest Source Folders


    Folder name Description
    GpsNmeaTransportTest 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.transport.test.  
      GpsNmeaTransportTest:  
      This class is a template GpsNmeaTransportTest.
    • org.eclipse.soda.dk.gps.nmea.transport.test.bundle.  
      GpsNmeaTransportTestBundleActivator:  
      This class is an OSGi bundle activator for GpsNmeaTransportTest.
    • org.eclipse.soda.dk.gps.nmea.transport.service.   
      GpsNmeaTransportTestService:  
      This class defines the OSGi service to be registered for the GpsNmeaTransportTest.
    • Meta-Inf:  
      This folder contains the OSGi manifest file, MANIFEST.MF.
    GpsNmeaTransportTestDevelopment Contains the generated cml file that defines the properties for the transport test.
  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.

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