Open cloudxxx8 opened 5 years ago
We decided to implement this in the Initialize
function as a go-routine to enable reading from a mock data file and to avoid the overhead associated with opening the file/device every time HandleReadCommand
is invoked.
If I understand correctly, we can't access [DeviceList.Protocols.gps]
from Initialize
? If not, I think we should leave it hard coded on line 62 of driver/gpsdevice.go
until we can use the AddDevice
callback.
Yes, Initialize
can't read ProtocolProperties
because ProtocolProperties
is for a specific Device and Initialize
is for the Device Service.
AddDevice
should be available by the end of this month. Device Service working group is discussing the contract of these new callback functions.
Ok, I will change it once AddDevice
is available.
Hi @alexcourouble AddDevice
etc are now in the SDK - this patch has been merged
I change the dev/ttyUSB0,but not ok.it has no vaule
Currently, the scan logic of GPS Device Service is located in
Initialize
func, it caused this Device Service can only serve one GPS Device. By moving toHandleReadCommands
func, it can read ProtocolProperties as the suggestion in #29. The disadvantage is that it can only scan at runtime. In the next release, this logic could move to the new AddDevice callback stated in https://github.com/edgexfoundry/device-sdk-go/issues/276 This issue is just a suggestion.