This should be used sparingly. An existing connection created by the POS application and passed in to the PSDK. The connection should already be connected when passed in to the PSDK, and there is no mechanism to recover the connection when this is used. Once the PSDK is finished with this connection, a new connection should be provided for any future calls. Note: This type of connection should only use ConnectionStatus values DISCONNECTED through DISCONNECTING.
The PSDK calls this when it is done with the connection. In many cases, this means that the connection can be disconnected, and any associated resources can be cleaned up. All further calls to write should return
StatusCode.DEVICE_CONNECTION_LOSTto the ConnectionCallback. This is also called when cleaning up the connection after the connection is accidentally lost, so that any associated resources can be freed.
Return the connection ID. This ID should be unique per connection.
Return the current status.
Set the status callback. Any future changes to the status should be passed through here. If the callback is null, then any existing callback should be removed. If bytes are received from the connection before the callback is set, then they should be stored and sent once the callback is set, either immediately or at the next iteration of some loop.
Enables a message to be written on the connection asynchronously or synchronously. The connection callback must be notified of the result. The bytes sent might be empty, enabling a check of the connection.