TransportHandle
  public
  
  
  
  interface
  TransportHandle
  
  
      implements
      
        AutoCloseable
      
  
  
| android.ranging.oob.TransportHandle | 
TransportHandle is used as the Out-Of-Band (OOB) transport mechanism by ranging module. In cases where module is used in a non-raw ranging mode, the user shall provide an implementation of the TransportHandle, allowing ranging module to do the necessary OOB communication with a peer device using the provided transport handle. Some examples of OOB transport between two peer devices are:
- BLE GATT connection
 - Wi-Fi MDNS link
 - Internet
 
Summary
Nested classes | |
|---|---|
        
        
        
        
        interface | 
      
        TransportHandle.ReceiveCallback
        TransportHandle callback.  | 
    
Public methods | |
|---|---|
        abstract
        
        
        
        
        void
     | 
  
    
      
      registerReceiveCallback(Executor executor, TransportHandle.ReceiveCallback callback)
      
      
        Registers a callback to receive updates from the transport mechanism.  | 
  
        abstract
        
        
        
        
        void
     | 
  
    
      
      sendData(byte[] data)
      
      
        Send data to the peer device via the implemented OOB transport.  | 
  
Inherited methods | |
|---|---|
Public methods
registerReceiveCallback
public abstract void registerReceiveCallback (Executor executor, TransportHandle.ReceiveCallback callback)
Registers a callback to receive updates from the transport mechanism.
The callback should be used to notify information about the peer device including the data received from the peer device.
| Parameters | |
|---|---|
executor | 
        
          Executor: the Executor on which the callback should be invoked. Must not be
                 null. | 
      
callback | 
        
          TransportHandle.ReceiveCallback: the ReceiveCallback instance to receive updates. Must not be null. | 
      
| Throws | |
|---|---|
IllegalArgumentException | 
          if either executor or callback is null. | 
        
sendData
public abstract void sendData (byte[] data)
Send data to the peer device via the implemented OOB transport.
| Parameters | |
|---|---|
data | 
        
          byte: the data to be sent to the peer device. Must not be null. | 
      
| Throws | |
|---|---|
IllegalArgumentException | 
          if the provided data is null or invalid | 
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-03-13 UTC.