Package 

Class DefaultMtuSplitter

  • All Implemented Interfaces:
    no.nordicsemi.android.ble.data.DataSplitter

    
    public final class DefaultMtuSplitter
     implements DataSplitter
                        

    Splits the message into at-most MTU-3 size packets.

    • Method Summary

      Modifier and Type Method Description
      Array<byte> chunk(@NonNull() Array<byte> message, @IntRange(from = 0) int index, @IntRange(from = 20) int maxLength) The implementation should return a index'th byte array from given message,with at most maxLength size, or null if no bytes are left to be sent.
      • Methods inherited from class no.nordicsemi.android.ble.data.DataSplitter

        chunk
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • chunk

        @Nullable() Array<byte> chunk(@NonNull() Array<byte> message, @IntRange(from = 0) int index, @IntRange(from = 20) int maxLength)

        The implementation should return a index'th byte array from given message,with at most maxLength size, or null if no bytes are left to be sent.

        Parameters:
        message - the full message to be chunk.
        index - index of a packet, 0-based.
        maxLength - maximum length of the returned packet.