Documentation
¶
Overview ¶
Package sync provides functions for synchronizing and processing updates related to serial port discovery.
This package includes functions for comparing two lists of serial ports and sending 'add' and 'remove' events based on the differences between the lists. It also includes utility functions for converting port details to the discovery protocol format.
The main function in this package is `processUpdates`, which takes in two lists of serial port details and an event callback function. It compares the two lists and sends 'add' and 'remove' events based on the differences. The `portListHas` function is used to check if a port is contained in a list, and the `toDiscoveryPort` function is used to convert port details to the discovery protocol format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Start ¶
func Start(eventCB discovery.EventCallback, errorCB discovery.ErrorCallback) (chan<- bool, error)
Start the sync process, successful events will be passed to eventCB, errors to errorCB. Returns a channel used to stop the sync process. Returns error if sync process can't be started.
Types ¶
This section is empty.