edgexfoundry-holding / device-gps

Apache License 2.0
4 stars 7 forks source link

Refine the protocol properties of GPS Device #29

Closed cloudxxx8 closed 5 years ago

cloudxxx8 commented 5 years ago

Currently in configuration.toml, the protocol properties are defined as follows: https://github.com/edgexfoundry-holding/device-gps/blob/master/cmd/res/configuration.toml#L64-L67

However, the Address and Port are not used in the driver. We only need to define the ProtocolProperties driver needs to connect to the real device, for example:

  [DeviceList.Protocols]
    [DeviceList.Protocols.gps]
      Path = "/dev/ttyUSB0"

In this case, the hard code path of GPS Device could be moved into the ProtocolProperties.

cloudxxx8 commented 5 years ago

In README.md:

The default device service behavior is to read from the mock data file. This needs to be changed. Edit line 91 in driver/gpsdevice.go, changing gps_output_test.txt to /dev/ttyUSB0.

However, it is not in line 91 anymore, and it is in line 62. Thus, we had better avoid hard code the path.