test_class.declarator: rawImageA = intArrayToByteArray(new int[]{
              0x2B, 0x65,                // CRC
              0xFF, 0xFF,                // CRC Shadow
              0x64, 0x00,                // Version
              0x00, 0x7C,                // Length
              0x41, 0x41, 0x41, 0x41,    // Image A (ASCII 41)
              0xFF, 0xFF, 0xFF, 0xFF     // Reserved
      })
test_class.original_string: byte[] rawImageA = intArrayToByteArray(new int[]{
              0x2B, 0x65,                // CRC
              0xFF, 0xFF,                // CRC Shadow
              0x64, 0x00,                // Version
              0x00, 0x7C,                // Length
              0x41, 0x41, 0x41, 0x41,    // Image A (ASCII 41)
              0xFF, 0xFF, 0xFF, 0xFF     // Reserved
      });
test_class.type: byte[]
test_class.var_name: rawImageA
test_class.declarator: rawImageB = intArrayToByteArray(new int[]{
              0x2B, 0x65,                // CRC
              0xFF, 0xFF,                // CRC Shadow
              0x64, 0x00,                // Version
              0x00, 0x7C,                // Length
              0x42, 0x42, 0x42, 0x42,    // Image B (ASCII 42)
              0xFF, 0xFF, 0xFF, 0xFF     // Reserved
      })
test_class.original_string: byte[] rawImageB = intArrayToByteArray(new int[]{
              0x2B, 0x65,                // CRC
              0xFF, 0xFF,                // CRC Shadow
              0x64, 0x00,                // Version
              0x00, 0x7C,                // Length
              0x42, 0x42, 0x42, 0x42,    // Image B (ASCII 42)
              0xFF, 0xFF, 0xFF, 0xFF     // Reserved
      });
test_class.type: byte[]
test_class.var_name: rawImageB
test_class.declarator: fwVersionCallback
test_class.original_string: DeviceProfile.VersionCallback fwVersionCallback;
test_class.type: DeviceProfile.VersionCallback
test_class.var_name: fwVersionCallback
test_class.declarator: testErrors = new ArrayList<>()
test_class.original_string: List<BeanError> testErrors = new ArrayList<>();
test_class.type: List<BeanError>
test_class.var_name: testErrors
test_class.declarator: mockGattClient
test_class.original_string: GattClient mockGattClient;
test_class.type: GattClient
test_class.var_name: mockGattClient
test_class.declarator: mockOADService
test_class.original_string: BluetoothGattService mockOADService;
test_class.type: BluetoothGattService
test_class.var_name: mockOADService
test_class.declarator: mockOADIdentify
test_class.original_string: BluetoothGattCharacteristic mockOADIdentify;
test_class.type: BluetoothGattCharacteristic
test_class.var_name: mockOADIdentify
test_class.declarator: mockOADBlock
test_class.original_string: BluetoothGattCharacteristic mockOADBlock;
test_class.type: BluetoothGattCharacteristic
test_class.var_name: mockOADBlock
test_class.declarator: mockOADIdentifyDescriptor
test_class.original_string: BluetoothGattDescriptor mockOADIdentifyDescriptor;
test_class.type: BluetoothGattDescriptor
test_class.var_name: mockOADIdentifyDescriptor
test_class.declarator: mockOADBlockDescriptor
test_class.original_string: BluetoothGattDescriptor mockOADBlockDescriptor;
test_class.type: BluetoothGattDescriptor
test_class.var_name: mockOADBlockDescriptor
test_class.declarator: services = new ArrayList<>()
test_class.original_string: List<BluetoothGattService> services = new ArrayList<>();
test_class.type: List<BluetoothGattService>
test_class.var_name: services
test_class.declarator: mockDeviceProfile
test_class.original_string: DeviceProfile mockDeviceProfile;
test_class.type: DeviceProfile
test_class.var_name: mockDeviceProfile
test_class.declarator: mockBeanManager
test_class.original_string: BeanManager mockBeanManager;
test_class.type: BeanManager
test_class.var_name: mockBeanManager
test_class.declarator: oadProfile
test_class.original_string: OADProfile oadProfile;
test_class.type: OADProfile
test_class.var_name: oadProfile
test_class.file: sdk/src/test/java/com/punchthrough/bean/sdk/internal/upload/firmware/OADProfileTest.java
test_class.identifier: OADProfileTest
test_case.body: @Test
      public void testNoUpdateNeeded() throws ImageParsingException {
          OADProfile.OADListener oadListener = mock(OADProfile.OADListener.class);
          OADProfile.OADApproval oadApproval = oadProfile.programWithFirmware(buildBundle(), oadListener);
          assertState(OADState.CHECKING_FW_VERSION);
          fwVersionCallback.onComplete("12345");  // Same as bundle version
          assertState(OADState.INACTIVE);
          verify(oadListener).updateRequired(false);
          verify(oadListener, never()).error(any(BeanError.class));
      }
test_case.class_method_signature: OADProfileTest.testNoUpdateNeeded()
test_case.full_signature: @Test public void testNoUpdateNeeded()
test_case.identifier: testNoUpdateNeeded
test_case.invocations: mock programWithFirmware buildBundle assertState onComplete assertState updateRequired verify error verify never any
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNoUpdateNeeded()
focal_class.declarator: TAG = "OADProfile"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String TAG = "OADProfile";
focal_class.type: String
focal_class.var_name: TAG
focal_class.declarator: oadIdentify
focal_class.modifier: private
focal_class.original_string: private BluetoothGattCharacteristic oadIdentify;
focal_class.type: BluetoothGattCharacteristic
focal_class.var_name: oadIdentify
focal_class.declarator: oadBlock
focal_class.modifier: private
focal_class.original_string: private BluetoothGattCharacteristic oadBlock;
focal_class.type: BluetoothGattCharacteristic
focal_class.var_name: oadBlock
focal_class.declarator: watchdog
focal_class.modifier: private
focal_class.original_string: private Watchdog watchdog;
focal_class.type: Watchdog
focal_class.var_name: watchdog
focal_class.declarator: OAD_TIMEOUT_SECONDS = 30
focal_class.modifier: private static final
focal_class.original_string: private static final int OAD_TIMEOUT_SECONDS = 30;
focal_class.type: int
focal_class.var_name: OAD_TIMEOUT_SECONDS
focal_class.declarator: ready = false
focal_class.modifier: private
focal_class.original_string: private boolean ready = false;
focal_class.type: boolean
focal_class.var_name: ready
focal_class.declarator: oadState = OADState.INACTIVE
focal_class.modifier: private
focal_class.original_string: private OADState oadState = OADState.INACTIVE;
focal_class.type: OADState
focal_class.var_name: oadState
focal_class.declarator: currentImage
focal_class.modifier: private
focal_class.original_string: private FirmwareImage currentImage;
focal_class.type: FirmwareImage
focal_class.var_name: currentImage
focal_class.declarator: firmwareBundle
focal_class.modifier: private
focal_class.original_string: private FirmwareBundle firmwareBundle;
focal_class.type: FirmwareBundle
focal_class.var_name: firmwareBundle
focal_class.declarator: oadListener
focal_class.modifier: private
focal_class.original_string: private OADListener oadListener;
focal_class.type: OADListener
focal_class.var_name: oadListener
focal_class.declarator: MAX_IN_AIR_BLOCKS = 8
focal_class.modifier: private final
focal_class.original_string: private final int MAX_IN_AIR_BLOCKS = 8;
focal_class.type: int
focal_class.var_name: MAX_IN_AIR_BLOCKS
focal_class.declarator: nextBlock = 0
focal_class.modifier: private
focal_class.original_string: private int nextBlock = 0;
focal_class.type: int
focal_class.var_name: nextBlock
focal_class.declarator: blockTransferStarted = 0
focal_class.modifier: private
focal_class.original_string: private long blockTransferStarted = 0;
focal_class.type: long
focal_class.var_name: blockTransferStarted
focal_class.declarator: watchdogListener = new Watchdog.WatchdogListener() {
          @Override
          public void expired() {
              fail(BeanError.OAD_TIMEOUT);
          }
      }
focal_class.modifier: private
focal_class.original_string: private Watchdog.WatchdogListener watchdogListener = new Watchdog.WatchdogListener() {
          @Override
          public void expired() {
              fail(BeanError.OAD_TIMEOUT);
          }
      };
focal_class.type: Watchdog.WatchdogListener
focal_class.var_name: watchdogListener
focal_class.declarator: oadApproval = new OADApproval() {
  
          public boolean approved = false;
  
          @Override
          public void allow() {
              Log.i(TAG, "Client has allowed the OAD Process to continue.");
              approved = true;
              startOfferingImages();
              watchdog.start(OAD_TIMEOUT_SECONDS, watchdogListener);
          }
  
          @Override
          public void deny() {
              Log.i(TAG, "Client denied the OAD Process from continuing.");
              approved = false;
              fail(BeanError.CLIENT_REJECTED);
          }
  
          @Override
          public void reset() {
              approved = false;
          }
  
          @Override
          public boolean isApproved() {
              return approved;
          }
      }
focal_class.modifier: private
focal_class.original_string: private OADApproval oadApproval = new OADApproval() {
  
          public boolean approved = false;
  
          @Override
          public void allow() {
              Log.i(TAG, "Client has allowed the OAD Process to continue.");
              approved = true;
              startOfferingImages();
              watchdog.start(OAD_TIMEOUT_SECONDS, watchdogListener);
          }
  
          @Override
          public void deny() {
              Log.i(TAG, "Client denied the OAD Process from continuing.");
              approved = false;
              fail(BeanError.CLIENT_REJECTED);
          }
  
          @Override
          public void reset() {
              approved = false;
          }
  
          @Override
          public boolean isApproved() {
              return approved;
          }
      };
focal_class.type: OADApproval
focal_class.var_name: oadApproval
focal_class.file: sdk/src/main/java/com/punchthrough/bean/sdk/internal/upload/firmware/OADProfile.java
focal_class.identifier: OADProfile
focal_class.class_method_signature: OADProfile.OADProfile(GattClient client, Watchdog watchdog)
focal_class.full_signature: public  OADProfile(GattClient client, Watchdog watchdog)
focal_class.identifier: OADProfile
focal_class.modifiers: public
focal_class.parameters: (GattClient client, Watchdog watchdog)
focal_class.signature:  OADProfile(GattClient client, Watchdog watchdog)
focal_class.class_method_signature: OADProfile.setState(OADState state)
focal_class.full_signature: private void setState(OADState state)
focal_class.identifier: setState
focal_class.modifiers: private
focal_class.parameters: (OADState state)
focal_class.return: void
focal_class.signature: void setState(OADState state)
focal_class.class_method_signature: OADProfile.reset()
focal_class.full_signature: private void reset()
focal_class.identifier: reset
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void reset()
focal_class.class_method_signature: OADProfile.reconnect()
focal_class.full_signature: private void reconnect()
focal_class.identifier: reconnect
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void reconnect()
focal_class.class_method_signature: OADProfile.offerNextImage()
focal_class.full_signature: private void offerNextImage()
focal_class.identifier: offerNextImage
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void offerNextImage()
focal_class.class_method_signature: OADProfile.startOfferingImages()
focal_class.full_signature: private void startOfferingImages()
focal_class.identifier: startOfferingImages
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void startOfferingImages()
focal_class.class_method_signature: OADProfile.onNotificationIdentify(BluetoothGattCharacteristic characteristic)
focal_class.full_signature: private void onNotificationIdentify(BluetoothGattCharacteristic characteristic)
focal_class.identifier: onNotificationIdentify
focal_class.modifiers: private
focal_class.parameters: (BluetoothGattCharacteristic characteristic)
focal_class.return: void
focal_class.signature: void onNotificationIdentify(BluetoothGattCharacteristic characteristic)
focal_class.class_method_signature: OADProfile.onNotificationBlock(BluetoothGattCharacteristic characteristic)
focal_class.full_signature: private void onNotificationBlock(BluetoothGattCharacteristic characteristic)
focal_class.identifier: onNotificationBlock
focal_class.modifiers: private
focal_class.parameters: (BluetoothGattCharacteristic characteristic)
focal_class.return: void
focal_class.signature: void onNotificationBlock(BluetoothGattCharacteristic characteristic)
focal_class.class_method_signature: OADProfile.setupOAD()
focal_class.full_signature: private void setupOAD()
focal_class.identifier: setupOAD
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void setupOAD()
focal_class.class_method_signature: OADProfile.setupNotifications()
focal_class.full_signature: private void setupNotifications()
focal_class.identifier: setupNotifications
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void setupNotifications()
focal_class.class_method_signature: OADProfile.enableNotifyForChar(BluetoothGattCharacteristic characteristic)
focal_class.full_signature: private boolean enableNotifyForChar(BluetoothGattCharacteristic characteristic)
focal_class.identifier: enableNotifyForChar
focal_class.modifiers: private
focal_class.parameters: (BluetoothGattCharacteristic characteristic)
focal_class.return: boolean
focal_class.signature: boolean enableNotifyForChar(BluetoothGattCharacteristic characteristic)
focal_class.class_method_signature: OADProfile.writeToCharacteristic(BluetoothGattCharacteristic charc, byte[] data)
focal_class.full_signature: private boolean writeToCharacteristic(BluetoothGattCharacteristic charc, byte[] data)
focal_class.identifier: writeToCharacteristic
focal_class.modifiers: private
focal_class.parameters: (BluetoothGattCharacteristic charc, byte[] data)
focal_class.return: boolean
focal_class.signature: boolean writeToCharacteristic(BluetoothGattCharacteristic charc, byte[] data)
focal_class.class_method_signature: OADProfile.needsUpdate(Long bundleVersion, String beanVersion)
focal_class.full_signature: private boolean needsUpdate(Long bundleVersion, String beanVersion)
focal_class.identifier: needsUpdate
focal_class.modifiers: private
focal_class.parameters: (Long bundleVersion, String beanVersion)
focal_class.return: boolean
focal_class.signature: boolean needsUpdate(Long bundleVersion, String beanVersion)
focal_class.class_method_signature: OADProfile.checkFirmwareVersion()
focal_class.full_signature: private void checkFirmwareVersion()
focal_class.identifier: checkFirmwareVersion
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void checkFirmwareVersion()
focal_class.class_method_signature: OADProfile.fail(BeanError error)
focal_class.full_signature: private void fail(BeanError error)
focal_class.identifier: fail
focal_class.modifiers: private
focal_class.parameters: (BeanError error)
focal_class.return: void
focal_class.signature: void fail(BeanError error)
focal_class.class_method_signature: OADProfile.finishUpdateOccurred()
focal_class.full_signature: private void finishUpdateOccurred()
focal_class.identifier: finishUpdateOccurred
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void finishUpdateOccurred()
focal_class.class_method_signature: OADProfile.finishNoUpdateOccurred()
focal_class.full_signature: private void finishNoUpdateOccurred()
focal_class.identifier: finishNoUpdateOccurred
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void finishNoUpdateOccurred()
focal_class.class_method_signature: OADProfile.getName()
focal_class.full_signature: public String getName()
focal_class.identifier: getName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_class.class_method_signature: OADProfile.isReady()
focal_class.full_signature: public boolean isReady()
focal_class.identifier: isReady
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isReady()
focal_class.class_method_signature: OADProfile.clearReady()
focal_class.full_signature: public void clearReady()
focal_class.identifier: clearReady
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clearReady()
focal_class.class_method_signature: OADProfile.uploadInProgress()
focal_class.full_signature: public boolean uploadInProgress()
focal_class.identifier: uploadInProgress
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean uploadInProgress()
focal_class.class_method_signature: OADProfile.getState()
focal_class.full_signature: public OADState getState()
focal_class.identifier: getState
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: OADState
focal_class.signature: OADState getState()
focal_class.class_method_signature: OADProfile.onProfileReady()
focal_class.full_signature: @Override public void onProfileReady()
focal_class.identifier: onProfileReady
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void onProfileReady()
focal_class.class_method_signature: OADProfile.continueOAD()
focal_class.full_signature: public void continueOAD()
focal_class.identifier: continueOAD
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void continueOAD()
focal_class.class_method_signature: OADProfile.onBeanConnected()
focal_class.full_signature: @Override public void onBeanConnected()
focal_class.identifier: onBeanConnected
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void onBeanConnected()
focal_class.class_method_signature: OADProfile.onBeanDisconnected()
focal_class.full_signature: @Override public void onBeanDisconnected()
focal_class.identifier: onBeanDisconnected
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void onBeanDisconnected()
focal_class.class_method_signature: OADProfile.onBeanConnectionFailed()
focal_class.full_signature: @Override public void onBeanConnectionFailed()
focal_class.identifier: onBeanConnectionFailed
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void onBeanConnectionFailed()
focal_class.class_method_signature: OADProfile.onCharacteristicChanged(GattClient client, BluetoothGattCharacteristic characteristic)
focal_class.full_signature: @Override public void onCharacteristicChanged(GattClient client, BluetoothGattCharacteristic characteristic)
focal_class.identifier: onCharacteristicChanged
focal_class.modifiers: @Override public
focal_class.parameters: (GattClient client, BluetoothGattCharacteristic characteristic)
focal_class.return: void
focal_class.signature: void onCharacteristicChanged(GattClient client, BluetoothGattCharacteristic characteristic)
focal_class.class_method_signature: OADProfile.programWithFirmware(final FirmwareBundle bundle, OADListener listener)
focal_class.full_signature: public OADApproval programWithFirmware(final FirmwareBundle bundle, OADListener listener)
focal_class.identifier: programWithFirmware
focal_class.modifiers: public
focal_class.parameters: (final FirmwareBundle bundle, OADListener listener)
focal_class.return: OADApproval
focal_class.signature: OADApproval programWithFirmware(final FirmwareBundle bundle, OADListener listener)
focal_class.superclass: extends BaseProfile
focal_method.body: public OADApproval programWithFirmware(final FirmwareBundle bundle, OADListener listener) {
  
          if (!mGattClient.isConnected()) {
              listener.error(BeanError.NOT_CONNECTED);
          }
  
          Log.i(TAG, "Starting firmware update procedure");
  
          // Save state for this firmware procedure
          this.oadListener = listener;
          this.firmwareBundle = bundle;
  
          watchdog.start(OAD_TIMEOUT_SECONDS, watchdogListener);
          checkFirmwareVersion();
  
          return this.oadApproval;
      }
focal_method.class_method_signature: OADProfile.programWithFirmware(final FirmwareBundle bundle, OADListener listener)
focal_method.full_signature: public OADApproval programWithFirmware(final FirmwareBundle bundle, OADListener listener)
focal_method.identifier: programWithFirmware
focal_method.invocations: isConnected error i start checkFirmwareVersion
focal_method.modifiers: public
focal_method.parameters: (final FirmwareBundle bundle, OADListener listener)
focal_method.return: OADApproval
focal_method.signature: OADApproval programWithFirmware(final FirmwareBundle bundle, OADListener listener)