code: private void onNotificationBlock(BluetoothGattCharacteristic characteristic) {
  
          int requestedBlock = Convert.twoBytesToInt(characteristic.getValue(), Constants.CC2540_BYTE_ORDER);
  
          // Check for First block
          if (requestedBlock == 0) {
              Log.i(TAG, String.format("Image accepted (Name: %s) (Size: %s bytes)",currentImage.name(), currentImage.sizeBytes()));
              blockTransferStarted = System.currentTimeMillis() / 1000L;
              setState(OADState.BLOCK_XFER);
              nextBlock = 0;
          }
  
          // Normal BLOCK XFER state logic
          while (oadState == OADState.BLOCK_XFER &&
                 nextBlock <= currentImage.blockCount() - 1 &&
                 nextBlock < (requestedBlock + MAX_IN_AIR_BLOCKS)) {
  
              // Write the block, tell the OAD Listener
              writeToCharacteristic(oadBlock, currentImage.block(nextBlock));
              oadListener.progress(UploadProgress.create(nextBlock + 1, currentImage.blockCount()));
              nextBlock++;
              watchdog.poke();
          }
  
          // Check for final block requested, for logging purposes only
          if (requestedBlock == currentImage.blockCount() - 1) {
  
              // Calculate throughput
              long secondsElapsed = System.currentTimeMillis() / 1000L - blockTransferStarted;
              double KBs = 0;
              if (secondsElapsed > 0) {
                  KBs = (double) (currentImage.sizeBytes() / secondsElapsed) / 1000;
              }
  
              // Log some stats
              Log.i(TAG, String.format("Final OAD Block Requested: %s/%s", nextBlock, currentImage.blockCount()));
              Log.i(TAG, String.format("Sent %d blocks in %d seconds (%.2f KB/s)", currentImage.blockCount(), secondsElapsed, KBs));
          }
  
      }
docs: Received a notification on Block characteristic
  
  A notification to this characteristic means the Bean has accepted the most recent
  firmware file we have offered, which is stored as `this.currentImage`. It is now
  time to start sending blocks of FW to the device.
  
  @param characteristic BLE characteristic with a value equal to the the block number