Interface ICloverTransport
- All Known Implementing Classes:
CloverTransport,DualDisplayCloverTransport,NativeCloverTransport,USBCloverTransport,WebSocketCloverTransport
public interface ICloverTransport
Interface to operate on an underlying transport
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddObserver(ICloverTransportObserver observer) Registers a listener to receive connect events and messages from the transportvoiddispose()Closes the connection to the underlying transportvoidInitializes the connection using the underlying transportvoidremoveObserver(ICloverTransportObserver observer) Remove a previously added listener.intsendMessage(String message) Sends the specified encoded message
-
Method Details
-
initializeConnection
void initializeConnection()Initializes the connection using the underlying transport -
dispose
void dispose()Closes the connection to the underlying transport -
addObserver
Registers a listener to receive connect events and messages from the transport- Parameters:
observer- listener to add
-
removeObserver
Remove a previously added listener. If the provided listener is not registered, this call has no effect.- Parameters:
observer- listener to remove
-
sendMessage
Sends the specified encoded message- Parameters:
message- encoded message to send- Returns:
- 0 if successful, -1 if failure
- Throws:
NotYetConnectedException- if the message is sent when the underlying transport is not connected
-