no.nordicsemi.android.log.LogSession Java Examples

The following examples show how to use no.nordicsemi.android.log.LogSession. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NrfMeshRepository.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * Connect to peripheral
 *
 * @param context          Context
 * @param device           {@link ExtendedBluetoothDevice} device
 * @param connectToNetwork True if connecting to an unprovisioned node or proxy node
 */
void connect(final Context context, final ExtendedBluetoothDevice device, final boolean connectToNetwork) {
    mMeshNetworkLiveData.setNodeName(device.getName());
    mIsProvisioningComplete = false;
    mIsCompositionDataReceived = false;
    mIsDefaultTtlReceived = false;
    mIsAppKeyAddCompleted = false;
    mIsNetworkRetransmitSetCompleted = false;
    //clearExtendedMeshNode();
    final LogSession logSession = Logger.newSession(context, null, device.getAddress(), device.getName());
    mBleMeshManager.setLogger(logSession);
    final BluetoothDevice bluetoothDevice = device.getDevice();
    initIsConnectedLiveData(connectToNetwork);
    mConnectionState.postValue("Connecting....");
    //Added a 1 second delay for connection, mostly to wait for a disconnection to complete before connecting.
    mHandler.postDelayed(() -> mBleMeshManager.connect(bluetoothDevice).retry(3, 200).enqueue(), 1000);
}
 
Example #2
Source File: BlinkyViewModel.java    From Android-nRF-Blinky with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Connect to the given peripheral.
 *
 * @param target the target device.
 */
public void connect(@NonNull final DiscoveredBluetoothDevice target) {
	// Prevent from calling again when called again (screen orientation changed).
	if (device == null) {
		device = target.getDevice();
		final LogSession logSession = Logger
				.newSession(getApplication(), null, target.getAddress(), target.getName());
		blinkyManager.setLogger(logSession);
		reconnect();
	}
}
 
Example #3
Source File: BlinkyManager.java    From Android-nRF-Blinky with BSD 3-Clause "New" or "Revised" License 2 votes vote down vote up
/**
 * Sets the log session to be used for low level logging.
 * @param session the session, or null, if nRF Logger is not installed.
 */
public void setLogger(@Nullable final LogSession session) {
	logSession = session;
}