├── .github
└── workflows
│ └── deploy-to-nexus.yml
├── .gitignore
├── Gemfile
├── Gemfile.lock
├── LICENSE
├── README.md
├── advertiser-android-mock
├── .gitignore
├── Module.md
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── advertiser
│ └── android
│ └── mock
│ ├── BluetoothLeAdvertiserFactory.kt
│ └── internal
│ └── MockBluetoothLeAdvertiser.kt
├── advertiser-android
├── .gitignore
├── Module.md
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── advertiser
│ └── android
│ ├── BluetoothLeAdvertiserFactory.kt
│ └── internal
│ ├── NativeBluetoothLeAdvertiser.kt
│ ├── legacy
│ └── BluetoothLeAdvertiserLegacy.kt
│ ├── mapper
│ └── Mapper.kt
│ └── oreo
│ └── BluetoothLeAdvertiserOreo.kt
├── advertiser-core-android
├── .gitignore
├── Module.md
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── advertiser
│ └── android
│ ├── AdvertisingDataValidator.kt
│ ├── AdvertisingPayload.kt
│ ├── BluetoothLeAdvertiser.kt
│ └── internal
│ └── AdvertisingParametersValidator.kt
├── advertiser-core
├── .gitignore
├── Module.md
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── advertiser
│ ├── BluetoothLeAdvertiser.kt
│ └── exception
│ ├── AdvertisingNotStartedException.kt
│ └── ValidationException.kt
├── build.gradle.kts
├── client-android-mock
├── Module.md
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── client
│ └── android
│ └── mock
│ ├── CentralManagerFactory.kt
│ ├── MockCentralManager.kt
│ └── internal
│ ├── Mapper.kt
│ ├── MockCentralManagerImpl.kt
│ └── MockExecutor.kt
├── client-android
├── Module.md
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── client
│ └── android
│ ├── CentralManagerFactory.kt
│ └── internal
│ ├── BluetoothGatt.kt
│ ├── Mapper.kt
│ ├── NativeCentralManagerImpl.kt
│ ├── NativeExecutor.kt
│ ├── NativeGattCallback.kt
│ ├── NativeGattEvent.kt
│ ├── NativeOperationMutex.kt
│ ├── NativeRemoteCharacteristic.kt
│ ├── NativeRemoteDescriptor.kt
│ ├── NativeRemoteService.kt
│ └── ScanFilterUtils.kt
├── client-core-android
├── Module.md
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── client
│ └── android
│ ├── AdvertisingData.kt
│ ├── AndroidGattEvent.kt
│ ├── CentralManager.kt
│ ├── ConnectionPriority.kt
│ ├── Peripheral.kt
│ ├── ScanFilterScope.kt
│ ├── ScanResult.kt
│ ├── exception
│ ├── BondingFailedException.kt
│ ├── PeripheralClosedException.kt
│ └── ScanningFailedToStartException.kt
│ ├── internal
│ ├── CentralManagerImpl.kt
│ └── ScanFilters.kt
│ └── preview
│ ├── PreviewPeripheral.kt
│ ├── PreviewRemoteCharacteristic.kt
│ ├── PreviewRemoteDescriptor.kt
│ └── PreviewRemoteService.kt
├── client-core
├── Module.md
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── client
│ ├── AdvertisingData.kt
│ ├── CentralManager.kt
│ ├── GattEvent.kt
│ ├── Monitoring.kt
│ ├── Peripheral.kt
│ ├── ReliableWriteScope.kt
│ ├── RemoteCharacteristic.kt
│ ├── RemoteDescriptor.kt
│ ├── RemoteService.kt
│ ├── ScanResult.kt
│ ├── exception
│ ├── BluetoothUnavailableException.kt
│ ├── ConnectionFailedException.kt
│ ├── InvalidAttributeException.kt
│ ├── OperationFailedException.kt
│ ├── PeripheralNotConnectedException.kt
│ ├── ScanningException.kt
│ └── ValueDoesNotMatchException.kt
│ └── internal
│ └── CentralManagerImpl.kt
├── client-mock
├── .gitignore
├── Module.md
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── client
│ └── mock
│ ├── DisconnectionReason.kt
│ ├── MockAdvertisementConfig.kt
│ ├── PeripheralSpec.kt
│ ├── PeripheralSpecEventHandler.kt
│ ├── Proximity.kt
│ ├── SimulationProvider.kt
│ └── internal
│ ├── MockBluetoothLeAdvertiser.kt
│ └── MockScanResult.kt
├── core-android-mock
├── Module.md
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── android
│ └── mock
│ └── MockEnvironment.kt
├── core-android
├── Module.md
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── core
│ └── android
│ ├── AdvertisingDataDefinition.kt
│ ├── AdvertisingDataScope.kt
│ └── internal
│ └── AdvertisingDataScopeImpl.kt
├── core-mock
├── .gitignore
├── Module.md
├── build.gradle.kts
└── src
│ └── main
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── core
│ └── mock
│ ├── AdvertisingDataDefinition.kt
│ ├── AdvertisingDataScope.kt
│ ├── MockEnvironment.kt
│ └── internal
│ └── AdvertisingDataScopeImpl.kt
├── core
├── Module.md
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── core
│ ├── AdvertisingDataDefinition.kt
│ ├── AdvertisingDataFlag.kt
│ ├── AdvertisingDataScope.kt
│ ├── AdvertisingDataType.kt
│ ├── AdvertisingInterval.kt
│ ├── AdvertisingSetParameters.kt
│ ├── BondState.kt
│ ├── Characteristic.kt
│ ├── CharacteristicProperty.kt
│ ├── ConnectionParameters.kt
│ ├── ConnectionState.kt
│ ├── Descriptor.kt
│ ├── GattConstants.kt
│ ├── Manager.kt
│ ├── OperationStatus.kt
│ ├── Peer.kt
│ ├── PeripheralType.kt
│ ├── Permission.kt
│ ├── Phy.kt
│ ├── PhyInUse.kt
│ ├── PhyOption.kt
│ ├── PrimaryPhy.kt
│ ├── ServerScope.kt
│ ├── Service.kt
│ ├── TxPowerLevel.kt
│ ├── WriteType.kt
│ ├── exception
│ ├── BluetoothException.kt
│ ├── GattException.kt
│ └── ManagerClosedException.kt
│ ├── internal
│ ├── AdvertisingDataScopeImpl.kt
│ ├── ServerScopeImpl.kt
│ └── ServiceDefinition.kt
│ └── util
│ ├── BluetoothUuid.kt
│ ├── Distinct.kt
│ └── Transform.kt
├── docs
└── html
│ ├── advertiser-android-mock
│ ├── index.html
│ ├── navigation.html
│ └── no.nordicsemi.kotlin.ble.advertiser.android.mock
│ │ ├── index.html
│ │ └── mock.html
│ ├── advertiser-android
│ ├── index.html
│ ├── navigation.html
│ └── no.nordicsemi.kotlin.ble.advertiser.android
│ │ ├── index.html
│ │ └── native.html
│ ├── advertiser-core-android
│ ├── index.html
│ ├── navigation.html
│ └── no.nordicsemi.kotlin.ble.advertiser.android
│ │ ├── -advertising-data-validator
│ │ ├── -advertising-data-validator.html
│ │ ├── index.html
│ │ └── validate.html
│ │ ├── -advertising-payload
│ │ ├── -advertising-payload.html
│ │ ├── advertising-data.html
│ │ ├── index.html
│ │ └── scan-response.html
│ │ ├── -bluetooth-le-advertiser
│ │ ├── -bluetooth-le-advertiser.html
│ │ ├── -factory
│ │ │ └── index.html
│ │ ├── advertise.html
│ │ ├── get-maximum-advertising-data-length.html
│ │ ├── index.html
│ │ ├── name-or-null.html
│ │ └── name.html
│ │ └── index.html
│ ├── advertiser-core
│ ├── index.html
│ ├── navigation.html
│ ├── no.nordicsemi.kotlin.ble.advertiser.exception
│ │ ├── -advertising-not-started-exception
│ │ │ ├── -advertising-not-started-exception.html
│ │ │ ├── -reason
│ │ │ │ ├── -a-l-r-e-a-d-y_-s-t-a-r-t-e-d
│ │ │ │ │ └── index.html
│ │ │ │ ├── -b-l-u-e-t-o-o-t-h_-n-o-t_-a-v-a-i-l-a-b-l-e
│ │ │ │ │ └── index.html
│ │ │ │ ├── -d-a-t-a_-t-o-o_-l-a-r-g-e
│ │ │ │ │ └── index.html
│ │ │ │ ├── -f-e-a-t-u-r-e_-u-n-s-u-p-p-o-r-t-e-d
│ │ │ │ │ └── index.html
│ │ │ │ ├── -i-l-l-e-g-a-l_-p-a-r-a-m-e-t-e-r-s
│ │ │ │ │ └── index.html
│ │ │ │ ├── -i-n-t-e-r-n-a-l_-e-r-r-o-r
│ │ │ │ │ └── index.html
│ │ │ │ ├── -t-o-o_-m-a-n-y_-a-d-v-e-r-t-i-s-e-r-s
│ │ │ │ │ └── index.html
│ │ │ │ ├── -u-n-k-n-o-w-n
│ │ │ │ │ └── index.html
│ │ │ │ ├── entries.html
│ │ │ │ ├── index.html
│ │ │ │ ├── to-string.html
│ │ │ │ ├── value-of.html
│ │ │ │ └── values.html
│ │ │ ├── index.html
│ │ │ └── reason.html
│ │ ├── -validation-exception
│ │ │ ├── -reason
│ │ │ │ ├── -d-a-t-a_-t-o-o_-l-a-r-g-e
│ │ │ │ │ └── index.html
│ │ │ │ ├── -e-x-t-e-n-d-e-d_-a-d-v-e-r-t-i-s-i-n-g_-n-o-t_-s-u-p-p-o-r-t-e-d
│ │ │ │ │ └── index.html
│ │ │ │ ├── -i-l-l-e-g-a-l_-p-a-r-a-m-e-t-e-r-s
│ │ │ │ │ └── index.html
│ │ │ │ ├── -p-h-y_-n-o-t_-s-u-p-p-o-r-t-e-d
│ │ │ │ │ └── index.html
│ │ │ │ ├── -s-c-a-n_-r-e-s-p-o-n-s-e_-n-o-t_-a-l-l-o-w-e-d
│ │ │ │ │ └── index.html
│ │ │ │ ├── -s-c-a-n_-r-e-s-p-o-n-s-e_-r-e-q-u-i-r-e-d
│ │ │ │ │ └── index.html
│ │ │ │ ├── entries.html
│ │ │ │ ├── index.html
│ │ │ │ ├── to-string.html
│ │ │ │ ├── value-of.html
│ │ │ │ └── values.html
│ │ │ ├── -validation-exception.html
│ │ │ ├── index.html
│ │ │ └── reason.html
│ │ └── index.html
│ └── no.nordicsemi.kotlin.ble.advertiser
│ │ ├── -bluetooth-le-advertiser
│ │ ├── -payload
│ │ │ └── index.html
│ │ ├── advertise.html
│ │ └── index.html
│ │ └── index.html
│ ├── client-android-mock
│ ├── index.html
│ ├── navigation.html
│ └── no.nordicsemi.kotlin.ble.client.android.mock
│ │ ├── -mock-central-manager
│ │ └── index.html
│ │ ├── index.html
│ │ └── mock.html
│ ├── client-android
│ ├── index.html
│ ├── navigation.html
│ └── no.nordicsemi.kotlin.ble.client.android
│ │ ├── index.html
│ │ └── native.html
│ ├── client-core-android
│ ├── index.html
│ ├── navigation.html
│ ├── no.nordicsemi.kotlin.ble.client.android.exception
│ │ ├── -bonding-failed-exception
│ │ │ ├── -bonding-failed-exception.html
│ │ │ └── index.html
│ │ ├── -peripheral-closed-exception
│ │ │ ├── -peripheral-closed-exception.html
│ │ │ └── index.html
│ │ ├── -scanning-failed-to-start-exception
│ │ │ ├── -reason
│ │ │ │ ├── -already-started
│ │ │ │ │ └── index.html
│ │ │ │ ├── -application-registration-failed
│ │ │ │ │ └── index.html
│ │ │ │ ├── -feature-unsupported
│ │ │ │ │ └── index.html
│ │ │ │ ├── -internal-error
│ │ │ │ │ └── index.html
│ │ │ │ ├── -out-of-resources
│ │ │ │ │ └── index.html
│ │ │ │ ├── -scanning-too-frequently
│ │ │ │ │ └── index.html
│ │ │ │ ├── -unknown
│ │ │ │ │ ├── -unknown.html
│ │ │ │ │ ├── code.html
│ │ │ │ │ └── index.html
│ │ │ │ └── index.html
│ │ │ ├── -scanning-failed-to-start-exception.html
│ │ │ ├── index.html
│ │ │ └── reason.html
│ │ └── index.html
│ ├── no.nordicsemi.kotlin.ble.client.android.preview
│ │ ├── -preview-inner-remote-service
│ │ │ ├── characteristics.html
│ │ │ ├── included-services.html
│ │ │ ├── index.html
│ │ │ ├── instance-id.html
│ │ │ ├── service.html
│ │ │ └── uuid.html
│ │ ├── -preview-peripheral
│ │ │ ├── -preview-peripheral.html
│ │ │ ├── index.html
│ │ │ └── to-string.html
│ │ ├── -preview-remote-characteristic
│ │ │ ├── -preview-remote-characteristic.html
│ │ │ ├── descriptors.html
│ │ │ ├── index.html
│ │ │ ├── instance-id.html
│ │ │ ├── is-notifying.html
│ │ │ ├── properties.html
│ │ │ ├── read.html
│ │ │ ├── service.html
│ │ │ ├── set-notifying.html
│ │ │ ├── subscribe.html
│ │ │ ├── uuid.html
│ │ │ ├── wait-for-value-change.html
│ │ │ └── write.html
│ │ ├── -preview-remote-descriptor
│ │ │ ├── -preview-remote-descriptor.html
│ │ │ ├── characteristic.html
│ │ │ ├── index.html
│ │ │ ├── instance-id.html
│ │ │ ├── read.html
│ │ │ ├── uuid.html
│ │ │ └── write.html
│ │ ├── -preview-remote-service
│ │ │ ├── -preview-remote-service.html
│ │ │ ├── characteristics.html
│ │ │ ├── included-services.html
│ │ │ ├── index.html
│ │ │ ├── instance-id.html
│ │ │ └── uuid.html
│ │ └── index.html
│ └── no.nordicsemi.kotlin.ble.client.android
│ │ ├── -advertising-data
│ │ ├── -advertising-data.html
│ │ ├── ad-structures.html
│ │ ├── complete-local-name.html
│ │ ├── flags.html
│ │ ├── index.html
│ │ ├── manufacturer-data.html
│ │ ├── mesh-beacon.html
│ │ ├── mesh-message.html
│ │ ├── mesh-pb-adv.html
│ │ ├── name.html
│ │ ├── raw.html
│ │ ├── service-data.html
│ │ ├── service-solicitation-uuids.html
│ │ ├── service-uuids.html
│ │ ├── shortened-local-name.html
│ │ └── tx-power-level.html
│ │ ├── -android-gatt-event
│ │ └── index.html
│ │ ├── -central-manager
│ │ ├── -connection-options
│ │ │ ├── -auto-connect
│ │ │ │ └── index.html
│ │ │ ├── -companion
│ │ │ │ ├── -default.html
│ │ │ │ └── index.html
│ │ │ ├── -direct
│ │ │ │ ├── -direct.html
│ │ │ │ ├── index.html
│ │ │ │ ├── preferred-phy.html
│ │ │ │ ├── retry-delay.html
│ │ │ │ ├── retry.html
│ │ │ │ └── timeout.html
│ │ │ └── index.html
│ │ ├── -factory
│ │ │ └── index.html
│ │ ├── connect.html
│ │ ├── get-bonded-peripherals.html
│ │ └── index.html
│ │ ├── -conjunction-filter-scope
│ │ └── index.html
│ │ ├── -connection-parameters-changed
│ │ ├── -connection-parameters-changed.html
│ │ ├── index.html
│ │ └── new-parameters.html
│ │ ├── -connection-priority
│ │ ├── -b-a-l-a-n-c-e-d
│ │ │ └── index.html
│ │ ├── -d-i-g-i-t-a-l_-c-a-r_-k-e-y
│ │ │ └── index.html
│ │ ├── -h-i-g-h
│ │ │ └── index.html
│ │ ├── -l-o-w_-p-o-w-e-r
│ │ │ └── index.html
│ │ ├── entries.html
│ │ ├── index.html
│ │ ├── value-of.html
│ │ └── values.html
│ │ ├── -disjunction-filter-scope
│ │ └── index.html
│ │ ├── -mtu-changed
│ │ ├── -mtu-changed.html
│ │ ├── index.html
│ │ └── mtu.html
│ │ ├── -peripheral
│ │ ├── -executor
│ │ │ ├── address.html
│ │ │ ├── bond-state.html
│ │ │ ├── create-bond.html
│ │ │ ├── index.html
│ │ │ ├── read-phy.html
│ │ │ ├── refresh-cache.html
│ │ │ ├── remove-bond.html
│ │ │ ├── request-connection-priority.html
│ │ │ ├── request-mtu.html
│ │ │ ├── request-phy.html
│ │ │ └── type.html
│ │ ├── -peripheral.html
│ │ ├── address.html
│ │ ├── bond-state.html
│ │ ├── connection-parameters.html
│ │ ├── create-bond.html
│ │ ├── has-bond-information.html
│ │ ├── identifier.html
│ │ ├── index.html
│ │ ├── maximum-write-value-length.html
│ │ ├── phy.html
│ │ ├── read-phy.html
│ │ ├── refresh-cache.html
│ │ ├── remove-bond.html
│ │ ├── request-connection-priority.html
│ │ ├── request-highest-value-length.html
│ │ ├── set-preferred-phy.html
│ │ ├── type.html
│ │ └── using-reliable-write.html
│ │ ├── -phy-changed
│ │ ├── -phy-changed.html
│ │ ├── index.html
│ │ └── phy.html
│ │ ├── -scan-filter-scope
│ │ ├── -address.html
│ │ ├── -all.html
│ │ ├── -any.html
│ │ ├── -custom.html
│ │ ├── -manufacturer-data.html
│ │ ├── -name.html
│ │ ├── -service-data.html
│ │ ├── -service-solicitation-uuid.html
│ │ ├── -service-uuid.html
│ │ └── index.html
│ │ ├── -scan-result
│ │ ├── -scan-result.html
│ │ ├── advertising-data.html
│ │ ├── index.html
│ │ ├── is-connectable.html
│ │ ├── peripheral.html
│ │ ├── primary-phy.html
│ │ ├── rssi.html
│ │ ├── secondary-phy.html
│ │ ├── timestamp.html
│ │ ├── to-string.html
│ │ └── tx-power-level.html
│ │ └── index.html
│ ├── client-core
│ ├── index.html
│ ├── navigation.html
│ ├── no.nordicsemi.kotlin.ble.client.exception
│ │ ├── -bluetooth-unavailable-exception
│ │ │ ├── -bluetooth-unavailable-exception.html
│ │ │ └── index.html
│ │ ├── -connection-failed-exception
│ │ │ ├── -connection-failed-exception.html
│ │ │ ├── index.html
│ │ │ └── reason.html
│ │ ├── -invalid-attribute-exception
│ │ │ ├── -invalid-attribute-exception.html
│ │ │ └── index.html
│ │ ├── -operation-failed-exception
│ │ │ ├── -operation-failed-exception.html
│ │ │ ├── index.html
│ │ │ └── reason.html
│ │ ├── -peripheral-not-connected-exception
│ │ │ ├── -peripheral-not-connected-exception.html
│ │ │ └── index.html
│ │ ├── -scanning-exception
│ │ │ ├── -scanning-exception.html
│ │ │ └── index.html
│ │ ├── -value-does-not-match-exception
│ │ │ ├── -value-does-not-match-exception.html
│ │ │ └── index.html
│ │ └── index.html
│ ├── no.nordicsemi.kotlin.ble.client.internal
│ │ ├── -central-manager-impl
│ │ │ ├── -central-manager-impl.html
│ │ │ ├── close.html
│ │ │ └── index.html
│ │ └── index.html
│ └── no.nordicsemi.kotlin.ble.client
│ │ ├── -advertising-data
│ │ ├── index.html
│ │ ├── manufacturer-data.html
│ │ ├── name.html
│ │ ├── service-data.html
│ │ ├── service-solicitation-uuids.html
│ │ ├── service-uuids.html
│ │ └── tx-power-level.html
│ │ ├── -any-remote-service
│ │ ├── included-services.html
│ │ ├── index.html
│ │ └── owner.html
│ │ ├── -central-manager
│ │ ├── -scan-filter-scope
│ │ │ └── index.html
│ │ ├── close.html
│ │ ├── connect.html
│ │ ├── get-peripheral-by-id.html
│ │ ├── get-peripherals-by-id.html
│ │ ├── index.html
│ │ ├── monitor.html
│ │ ├── range.html
│ │ └── scan.html
│ │ ├── -connection-state-changed
│ │ ├── -connection-state-changed.html
│ │ ├── disconnected.html
│ │ ├── index.html
│ │ └── new-state.html
│ │ ├── -gatt-event
│ │ ├── index.html
│ │ ├── is-disconnection-event.html
│ │ └── is-service-invalidated-event.html
│ │ ├── -impl-specific-event
│ │ ├── -impl-specific-event.html
│ │ └── index.html
│ │ ├── -monitoring-event
│ │ ├── index.html
│ │ └── peripheral.html
│ │ ├── -peripheral-entered-range
│ │ ├── -peripheral-entered-range.html
│ │ └── index.html
│ │ ├── -peripheral-left-range
│ │ ├── -peripheral-left-range.html
│ │ └── index.html
│ │ ├── -peripheral
│ │ ├── -executor
│ │ │ ├── close.html
│ │ │ ├── connect.html
│ │ │ ├── disconnect.html
│ │ │ ├── discover-services.html
│ │ │ ├── events.html
│ │ │ ├── identifier.html
│ │ │ ├── index.html
│ │ │ ├── initial-services.html
│ │ │ ├── initial-state.html
│ │ │ ├── is-closed.html
│ │ │ ├── name.html
│ │ │ └── read-rssi.html
│ │ ├── -peripheral.html
│ │ ├── disconnect.html
│ │ ├── equals.html
│ │ ├── hash-code.html
│ │ ├── identifier.html
│ │ ├── index.html
│ │ ├── is-connected.html
│ │ ├── is-disconnected.html
│ │ ├── maximum-write-value-length.html
│ │ ├── name.html
│ │ ├── read-rssi.html
│ │ ├── services.html
│ │ ├── state.html
│ │ └── to-string.html
│ │ ├── -proximity-changed
│ │ ├── -proximity-changed.html
│ │ ├── -proximity
│ │ │ ├── -f-a-r
│ │ │ │ └── index.html
│ │ │ ├── -i-m-m-e-d-i-a-t-e
│ │ │ │ └── index.html
│ │ │ ├── -n-e-a-r
│ │ │ │ └── index.html
│ │ │ ├── -u-n-k-n-o-w-n
│ │ │ │ └── index.html
│ │ │ ├── entries.html
│ │ │ ├── index.html
│ │ │ ├── value-of.html
│ │ │ └── values.html
│ │ ├── index.html
│ │ ├── previous-proximity.html
│ │ └── proximity.html
│ │ ├── -range-event
│ │ ├── index.html
│ │ └── peripheral.html
│ │ ├── -reliable-write-scope
│ │ ├── index.html
│ │ ├── maximum-write-value-length.html
│ │ └── write-reliably.html
│ │ ├── -remote-characteristic
│ │ ├── index.html
│ │ ├── is-notifying.html
│ │ ├── owner.html
│ │ ├── read.html
│ │ ├── service.html
│ │ ├── set-notifying.html
│ │ ├── subscribe.html
│ │ ├── wait-for-value-change.html
│ │ └── write.html
│ │ ├── -remote-descriptor
│ │ ├── characteristic.html
│ │ ├── index.html
│ │ ├── owner.html
│ │ ├── read.html
│ │ └── write.html
│ │ ├── -remote-included-service
│ │ ├── index.html
│ │ ├── owner.html
│ │ └── service.html
│ │ ├── -remote-service
│ │ ├── -remote-service.html
│ │ ├── index.html
│ │ └── owner.html
│ │ ├── -rssi-read
│ │ ├── -rssi-read.html
│ │ ├── index.html
│ │ └── rssi.html
│ │ ├── -scan-result
│ │ ├── advertising-data.html
│ │ ├── index.html
│ │ ├── is-connectable.html
│ │ ├── peripheral.html
│ │ ├── primary-phy.html
│ │ ├── rssi.html
│ │ ├── secondary-phy.html
│ │ ├── timestamp.html
│ │ └── tx-power-level.html
│ │ ├── -services-changed
│ │ └── index.html
│ │ ├── -services-discovered
│ │ ├── -services-discovered.html
│ │ ├── index.html
│ │ └── services.html
│ │ ├── distinct-by-peripheral.html
│ │ └── index.html
│ ├── client-mock
│ ├── index.html
│ ├── navigation.html
│ ├── no.nordicsemi.kotlin.ble.client.mock.internal
│ │ ├── -mock-bluetooth-le-advertiser
│ │ │ ├── -mock-bluetooth-le-advertiser.html
│ │ │ ├── cancel.html
│ │ │ ├── events.html
│ │ │ ├── index.html
│ │ │ └── simulate-advertising.html
│ │ ├── -mock-scan-result
│ │ │ ├── -mock-scan-result.html
│ │ │ ├── advertising-data.html
│ │ │ ├── index.html
│ │ │ ├── is-beacon.html
│ │ │ ├── is-connectable.html
│ │ │ ├── peripheral-spec.html
│ │ │ ├── primary-phy.html
│ │ │ ├── rssi.html
│ │ │ ├── secondary-phy.html
│ │ │ ├── timestamp.html
│ │ │ ├── to-string.html
│ │ │ └── tx-power-level.html
│ │ └── index.html
│ └── no.nordicsemi.kotlin.ble.client.mock
│ │ ├── -disconnection-reason
│ │ └── index.html
│ │ ├── -mock-advertisement-config
│ │ ├── -mock-advertisement-config.html
│ │ ├── advertising-data.html
│ │ ├── delay.html
│ │ ├── index.html
│ │ ├── is-advertising-when-connected.html
│ │ ├── is-beacon.html
│ │ ├── max-advertising-events.html
│ │ ├── parameters.html
│ │ └── timeout.html
│ │ ├── -peripheral-spec-event-handler
│ │ ├── index.html
│ │ ├── on-connection-lost.html
│ │ ├── on-connection-request.html
│ │ ├── on-mtu-request.html
│ │ ├── on-phy-request.html
│ │ ├── on-reset.html
│ │ └── on-service-discovery-request.html
│ │ ├── -peripheral-spec
│ │ ├── -builder
│ │ │ ├── advertising.html
│ │ │ ├── allow-for-retrieval.html
│ │ │ ├── bonded.html
│ │ │ ├── build.html
│ │ │ ├── connectable.html
│ │ │ ├── connected.html
│ │ │ └── index.html
│ │ ├── -companion
│ │ │ ├── index.html
│ │ │ └── simulate-peripheral.html
│ │ ├── advertisement.html
│ │ ├── connection-interval.html
│ │ ├── event-handler.html
│ │ ├── identifier.html
│ │ ├── index.html
│ │ ├── is-bonded.html
│ │ ├── is-connected.html
│ │ ├── is-known.html
│ │ ├── max-mtu.html
│ │ ├── name.html
│ │ ├── proximity.html
│ │ ├── services.html
│ │ ├── simulate-caching.html
│ │ ├── simulate-connection.html
│ │ ├── simulate-disconnection.html
│ │ ├── simulate-mac-change.html
│ │ ├── simulate-proximity-change.html
│ │ ├── simulate-reset.html
│ │ ├── supported-phy.html
│ │ └── type.html
│ │ ├── -proximity
│ │ ├── -f-a-r
│ │ │ └── index.html
│ │ ├── -i-m-m-e-d-i-a-t-e
│ │ │ └── index.html
│ │ ├── -n-e-a-r
│ │ │ └── index.html
│ │ ├── -o-u-t_-o-f_-r-a-n-g-e
│ │ │ └── index.html
│ │ ├── entries.html
│ │ ├── index.html
│ │ ├── value-of.html
│ │ └── values.html
│ │ ├── -simulation-provider
│ │ ├── index.html
│ │ ├── simulate-peripherals.html
│ │ ├── simulate-power-off.html
│ │ ├── simulate-power-on.html
│ │ └── tear-down-simulation.html
│ │ ├── -terminate-local-host
│ │ └── index.html
│ │ ├── -timeout
│ │ └── index.html
│ │ └── index.html
│ ├── core-android-mock
│ ├── index.html
│ ├── navigation.html
│ └── no.nordicsemi.kotlin.ble.android.mock
│ │ ├── -latest-api
│ │ └── index.html
│ │ ├── -mock-advertiser
│ │ └── index.html
│ │ ├── -mock-environment
│ │ ├── -android-sdk-version
│ │ │ ├── -android-sdk-version.html
│ │ │ ├── -companion
│ │ │ │ ├── -l-o-l-l-i-p-o-p.html
│ │ │ │ ├── -m-a-r-s-h-m-a-l-l-o-w.html
│ │ │ │ ├── -o-r-e-o.html
│ │ │ │ ├── -s.html
│ │ │ │ └── index.html
│ │ │ └── index.html
│ │ ├── -api21
│ │ │ ├── -api21.html
│ │ │ └── index.html
│ │ ├── -api23
│ │ │ ├── -api23.html
│ │ │ └── index.html
│ │ ├── -api26
│ │ │ ├── -api26.html
│ │ │ └── index.html
│ │ ├── -api31
│ │ │ ├── -api31.html
│ │ │ └── index.html
│ │ ├── advertiser.html
│ │ ├── android-sdk-version.html
│ │ ├── index.html
│ │ ├── is-bluetooth-advertise-permission-granted.html
│ │ ├── is-bluetooth-connect-permission-granted.html
│ │ ├── is-bluetooth-scan-permission-granted.html
│ │ ├── is-le-coded-phy-supported.html
│ │ ├── is-le-extended-advertising-supported.html
│ │ ├── is-le2-m-phy-supported.html
│ │ ├── is-location-enabled.html
│ │ ├── is-location-permission-granted.html
│ │ ├── is-location-required-for-scanning.html
│ │ ├── is-multiple-advertisement-supported.html
│ │ ├── is-scanning-on-le-coded-phy-supported.html
│ │ ├── le-maximum-advertising-data-length.html
│ │ ├── requires-bluetooth-runtime-permissions.html
│ │ └── scanner.html
│ │ ├── -mock-scanner
│ │ └── index.html
│ │ └── index.html
│ ├── core-android
│ ├── index.html
│ ├── navigation.html
│ └── no.nordicsemi.kotlin.ble.core.android
│ │ ├── -advertising-data-definition
│ │ ├── -advertising-data-definition.html
│ │ ├── include-device-name.html
│ │ ├── include-tx-power-level.html
│ │ ├── index.html
│ │ ├── manufacturer-data.html
│ │ ├── service-data.html
│ │ ├── service-solicitation-uuids.html
│ │ └── to-string.html
│ │ ├── -advertising-data-scope
│ │ ├── -include-local-name.html
│ │ ├── -include-tx-power-level.html
│ │ ├── -manufacturer-data.html
│ │ ├── -service-data.html
│ │ ├── -service-solicitation-uuid.html
│ │ └── index.html
│ │ └── index.html
│ ├── core-mock
│ ├── index.html
│ ├── navigation.html
│ ├── no.nordicsemi.kotlin.ble.core.mock.internal
│ │ ├── -advertising-data-scope-impl
│ │ │ ├── -advertising-data-scope-impl.html
│ │ │ ├── -complete-local-name.html
│ │ │ ├── -flags.html
│ │ │ ├── -include-tx-power-level.html
│ │ │ ├── -manufacturer-data.html
│ │ │ ├── -mesh-beacon.html
│ │ │ ├── -mesh-message.html
│ │ │ ├── -mesh-pb-adv.html
│ │ │ ├── -service-data.html
│ │ │ ├── -service-solicitation-uuid.html
│ │ │ ├── -shortened-local-name.html
│ │ │ ├── build.html
│ │ │ ├── index.html
│ │ │ └── is-empty.html
│ │ └── index.html
│ └── no.nordicsemi.kotlin.ble.core.mock
│ │ ├── -advertising-data-definition
│ │ ├── -advertising-data-definition.html
│ │ ├── complete-local-name.html
│ │ ├── flags.html
│ │ ├── index.html
│ │ ├── manufacturer-data.html
│ │ ├── mesh-beacon.html
│ │ ├── mesh-message.html
│ │ ├── mesh-pb-adv.html
│ │ ├── raw.html
│ │ ├── service-data.html
│ │ ├── service-solicitation-uuids.html
│ │ ├── shortened-local-name.html
│ │ └── tx-power-level.html
│ │ ├── -advertising-data-scope
│ │ ├── -complete-local-name.html
│ │ ├── -flags.html
│ │ ├── -include-tx-power-level.html
│ │ ├── -manufacturer-data.html
│ │ ├── -mesh-beacon.html
│ │ ├── -mesh-message.html
│ │ ├── -mesh-pb-adv.html
│ │ ├── -service-data.html
│ │ ├── -service-solicitation-uuid.html
│ │ ├── -shortened-local-name.html
│ │ └── index.html
│ │ ├── -mock-environment
│ │ ├── -mock-environment.html
│ │ ├── device-name.html
│ │ ├── index.html
│ │ ├── is-bluetooth-enabled.html
│ │ └── is-bluetooth-supported.html
│ │ └── index.html
│ ├── core
│ ├── index.html
│ ├── navigation.html
│ ├── no.nordicsemi.kotlin.ble.core.exception
│ │ ├── -bluetooth-exception
│ │ │ ├── -bluetooth-exception.html
│ │ │ └── index.html
│ │ ├── -gatt-exception
│ │ │ ├── -gatt-exception.html
│ │ │ └── index.html
│ │ ├── -manager-closed-exception
│ │ │ ├── -manager-closed-exception.html
│ │ │ └── index.html
│ │ └── index.html
│ ├── no.nordicsemi.kotlin.ble.core.util
│ │ ├── -merge-result
│ │ │ ├── -accumulate
│ │ │ │ ├── -accumulate.html
│ │ │ │ ├── accumulated.html
│ │ │ │ └── index.html
│ │ │ ├── -completed
│ │ │ │ ├── -completed.html
│ │ │ │ ├── index.html
│ │ │ │ └── result.html
│ │ │ └── index.html
│ │ ├── and.html
│ │ ├── base-uuid.html
│ │ ├── chunked.html
│ │ ├── distinct.html
│ │ ├── from-bytes.html
│ │ ├── from-short-uuid.html
│ │ ├── index.html
│ │ ├── is-short-uuid.html
│ │ ├── is16-bit-uuid.html
│ │ ├── is32-bit-uuid.html
│ │ ├── merge-indexed.html
│ │ ├── merge.html
│ │ ├── short-uuid.html
│ │ ├── split.html
│ │ ├── to-short-byte-array.html
│ │ └── to-short-string.html
│ └── no.nordicsemi.kotlin.ble.core
│ │ ├── -a-t-t_-m-t-u_-d-e-f-a-u-l-t.html
│ │ ├── -a-t-t_-m-t-u_-m-a-x.html
│ │ ├── -advertising-data-definition
│ │ ├── -advertising-data-definition.html
│ │ ├── index.html
│ │ └── service-uuids.html
│ │ ├── -advertising-data-flag
│ │ ├── -b-r_-e-d-r_-n-o-t_-s-u-p-p-o-r-t-e-d
│ │ │ └── index.html
│ │ ├── -l-e_-g-e-n-e-r-a-l_-d-i-s-c-o-v-e-r-a-b-l-e_-m-o-d-e
│ │ │ └── index.html
│ │ ├── -l-e_-l-i-m-i-t-e-d_-d-i-s-c-o-v-e-r-a-b-l-e_-m-o-d-e
│ │ │ └── index.html
│ │ ├── -s-i-m-u-l-t-a-n-e-o-u-s_-l-e_-b-r_-e-d-r_-t-o_-s-a-m-e_-d-e-v-i-c-e_-c-a-p-a-b-l-e_-c-o-n-t-r-o-l-l-e-r
│ │ │ └── index.html
│ │ ├── -s-i-m-u-l-t-a-n-e-o-u-s_-l-e_-b-r_-e-d-r_-t-o_-s-a-m-e_-d-e-v-i-c-e_-c-a-p-a-b-l-e_-h-o-s-t
│ │ │ └── index.html
│ │ ├── entries.html
│ │ ├── index.html
│ │ ├── mask.html
│ │ ├── to-string.html
│ │ ├── value-of.html
│ │ └── values.html
│ │ ├── -advertising-data-scope
│ │ ├── -service-uuid.html
│ │ └── index.html
│ │ ├── -advertising-data-type
│ │ ├── -a-d-v-e-r-t-i-s-i-n-g_-i-n-t-e-r-v-a-l
│ │ │ └── index.html
│ │ ├── -a-d-v-e-r-t-i-s-i-n-g_-i-n-t-e-r-v-a-l_-l-o-n-g
│ │ │ └── index.html
│ │ ├── -a-p-p-e-a-r-a-n-c-e
│ │ │ └── index.html
│ │ ├── -b-i-g_-i-n-f-o
│ │ │ └── index.html
│ │ ├── -b-r-o-a-d-c-a-s-t_-c-o-d-e
│ │ │ └── index.html
│ │ ├── -b-r-o-a-d-c-a-s-t_-n-a-m-e
│ │ │ └── index.html
│ │ ├── -c-h-a-n-n-e-l_-m-a-p_-u-p-d-a-t-e_-i-n-d-i-c-a-t-i-o-n
│ │ │ └── index.html
│ │ ├── -c-l-a-s-s_-o-f_-d-e-v-i-c-e
│ │ │ └── index.html
│ │ ├── -c-o-m-p-l-e-t-e_-l-i-s-t_-o-f_128_-b-i-t_-s-e-r-v-i-c-e_-u-u-i-d-s
│ │ │ └── index.html
│ │ ├── -c-o-m-p-l-e-t-e_-l-i-s-t_-o-f_16_-b-i-t_-s-e-r-v-i-c-e_-u-u-i-d-s
│ │ │ └── index.html
│ │ ├── -c-o-m-p-l-e-t-e_-l-i-s-t_-o-f_32_-b-i-t_-s-e-r-v-i-c-e_-u-u-i-d-s
│ │ │ └── index.html
│ │ ├── -c-o-m-p-l-e-t-e_-l-o-c-a-l_-n-a-m-e
│ │ │ └── index.html
│ │ ├── -companion
│ │ │ ├── create-or-null.html
│ │ │ └── index.html
│ │ ├── -d-e-v-i-c-e_-i-d
│ │ │ └── index.html
│ │ ├── -e-l-e-c-t-r-o-n-i-c_-s-h-e-l-f_-l-a-b-e-l
│ │ │ └── index.html
│ │ ├── -e-n-c-r-y-p-t-e-d_-a-d-v-e-r-t-i-s-i-n-g_-d-a-t-a
│ │ │ └── index.html
│ │ ├── -f-l-a-g-s
│ │ │ └── index.html
│ │ ├── -i-n-c-o-m-p-l-e-t-e_-l-i-s-t_-o-f_128_-b-i-t_-s-e-r-v-i-c-e_-u-u-i-d-s
│ │ │ └── index.html
│ │ ├── -i-n-c-o-m-p-l-e-t-e_-l-i-s-t_-o-f_16_-b-i-t_-s-e-r-v-i-c-e_-u-u-i-d-s
│ │ │ └── index.html
│ │ ├── -i-n-c-o-m-p-l-e-t-e_-l-i-s-t_-o-f_32_-b-i-t_-s-e-r-v-i-c-e_-u-u-i-d-s
│ │ │ └── index.html
│ │ ├── -i-n-d-o-o-r_-p-o-s-i-t-i-o-n-i-n-g
│ │ │ └── index.html
│ │ ├── -l-e_-b-l-u-e-t-o-o-t-h_-d-e-v-i-c-e_-a-d-d-r-e-s-s
│ │ │ └── index.html
│ │ ├── -l-e_-r-o-l-e
│ │ │ └── index.html
│ │ ├── -l-e_-s-e-c-u-r-e_-c-o-n-n-e-c-t-i-o-n-s_-c-o-n-f-i-r-m-a-t-i-o-n_-v-a-l-u-e
│ │ │ └── index.html
│ │ ├── -l-e_-s-e-c-u-r-e_-c-o-n-n-e-c-t-i-o-n-s_-r-a-n-d-o-m_-v-a-l-u-e
│ │ │ └── index.html
│ │ ├── -l-e_-s-u-p-p-o-r-t-e-d_-f-e-a-t-u-r-e-s
│ │ │ └── index.html
│ │ ├── -l-i-s-t_-o-f_128_-b-i-t_-s-e-r-v-i-c-e_-s-o-l-i-c-i-t-a-t-i-o-n_-u-u-i-d-s
│ │ │ └── index.html
│ │ ├── -l-i-s-t_-o-f_16_-b-i-t_-s-e-r-v-i-c-e_-s-o-l-i-c-i-t-a-t-i-o-n_-u-u-i-d-s
│ │ │ └── index.html
│ │ ├── -l-i-s-t_-o-f_32_-b-i-t_-s-e-r-v-i-c-e_-s-o-l-i-c-i-t-a-t-i-o-n_-u-u-i-d-s
│ │ │ └── index.html
│ │ ├── -m-a-n-u-f-a-c-t-u-r-e-r_-s-p-e-c-i-f-i-c_-d-a-t-a
│ │ │ └── index.html
│ │ ├── -m-e-s-h_-b-e-a-c-o-n
│ │ │ └── index.html
│ │ ├── -m-e-s-h_-m-e-s-s-a-g-e
│ │ │ └── index.html
│ │ ├── -p-b_-a-d-v
│ │ │ └── index.html
│ │ ├── -p-e-r-i-o-d-i-c_-a-d-v-e-r-t-i-s-i-n-g_-r-e-s-p-o-n-s-e_-t-i-m-i-n-g_-i-n-f-o-r-m-a-t-i-o-n
│ │ │ └── index.html
│ │ ├── -p-e-r-i-p-h-e-r-a-l_-c-o-n-n-e-c-t-i-o-n_-i-n-t-e-r-v-a-l_-r-a-n-g-e
│ │ │ └── index.html
│ │ ├── -p-u-b-l-i-c_-t-a-r-g-e-t_-a-d-d-r-e-s-s
│ │ │ └── index.html
│ │ ├── -r-a-n-d-o-m_-t-a-r-g-e-t_-a-d-d-r-e-s-s
│ │ │ └── index.html
│ │ ├── -r-e-s-o-l-v-a-b-l-e_-s-e-t_-i-d-e-n-t-i-f-i-e-r
│ │ │ └── index.html
│ │ ├── -s-e-c-u-r-i-t-y_-m-a-n-a-g-e-r_-o-u-t_-o-f_-b-a-n-d_-f-l-a-g-s
│ │ │ └── index.html
│ │ ├── -s-e-r-v-i-c-e_-d-a-t-a_128_-b-i-t
│ │ │ └── index.html
│ │ ├── -s-e-r-v-i-c-e_-d-a-t-a_16_-b-i-t
│ │ │ └── index.html
│ │ ├── -s-e-r-v-i-c-e_-d-a-t-a_32_-b-i-t
│ │ │ └── index.html
│ │ ├── -s-h-o-r-t-e-n-e-d_-l-o-c-a-l_-n-a-m-e
│ │ │ └── index.html
│ │ ├── -s-i-m-p-l-e_-p-a-i-r-i-n-g_-h-a-s-h_-c
│ │ │ └── index.html
│ │ ├── -s-i-m-p-l-e_-p-a-i-r-i-n-g_-h-a-s-h_-c_256
│ │ │ └── index.html
│ │ ├── -s-i-m-p-l-e_-p-a-i-r-i-n-g_-r-a-n-d-o-m-i-z-e-r_-r
│ │ │ └── index.html
│ │ ├── -s-i-m-p-l-e_-p-a-i-r-i-n-g_-r-a-n-d-o-m-i-z-e-r_-r_256
│ │ │ └── index.html
│ │ ├── -t-r-a-n-s-p-o-r-t_-d-i-s-c-o-v-e-r-y_-d-a-t-a
│ │ │ └── index.html
│ │ ├── -t-x_-p-o-w-e-r_-l-e-v-e-l
│ │ │ └── index.html
│ │ ├── -t-y-p-e_3-d_-i-n-f-o-r-m-a-t-i-o-n_-d-a-t-a
│ │ │ └── index.html
│ │ ├── -u-r-i
│ │ │ └── index.html
│ │ ├── entries.html
│ │ ├── index.html
│ │ ├── type.html
│ │ ├── value-of.html
│ │ └── values.html
│ │ ├── -advertising-interval
│ │ ├── -h-i-g-h.html
│ │ ├── -l-o-w.html
│ │ ├── -m-e-d-i-u-m.html
│ │ └── index.html
│ │ ├── -advertising-set-parameters
│ │ ├── connectable.html
│ │ ├── discoverable.html
│ │ ├── index.html
│ │ ├── interval.html
│ │ └── tx-power-level.html
│ │ ├── -any-service
│ │ ├── index.html
│ │ └── owner.html
│ │ ├── -bluetooth5-advertising-set-parameters
│ │ ├── -bluetooth5-advertising-set-parameters.html
│ │ ├── anonymous.html
│ │ ├── include-tx-power-level.html
│ │ ├── index.html
│ │ ├── primary-phy.html
│ │ ├── scannable.html
│ │ └── secondary-phy.html
│ │ ├── -bond-state
│ │ ├── -b-o-n-d-e-d
│ │ │ └── index.html
│ │ ├── -b-o-n-d-i-n-g
│ │ │ └── index.html
│ │ ├── -n-o-n-e
│ │ │ └── index.html
│ │ ├── entries.html
│ │ ├── index.html
│ │ ├── value-of.html
│ │ └── values.html
│ │ ├── -characteristic-property
│ │ ├── -b-r-o-a-d-c-a-s-t
│ │ │ └── index.html
│ │ ├── -e-x-t-e-n-d-e-d_-p-r-o-p-e-r-t-i-e-s
│ │ │ └── index.html
│ │ ├── -i-n-d-i-c-a-t-e
│ │ │ └── index.html
│ │ ├── -n-o-t-i-f-y
│ │ │ └── index.html
│ │ ├── -r-e-a-d
│ │ │ └── index.html
│ │ ├── -s-i-g-n-e-d_-w-r-i-t-e
│ │ │ └── index.html
│ │ ├── -w-r-i-t-e
│ │ │ └── index.html
│ │ ├── -w-r-i-t-e_-w-i-t-h-o-u-t_-r-e-s-p-o-n-s-e
│ │ │ └── index.html
│ │ ├── entries.html
│ │ ├── index.html
│ │ ├── value-of.html
│ │ ├── values.html
│ │ └── write-type.html
│ │ ├── -characteristic-scope
│ │ ├── -characteristic-user-description-descriptor.html
│ │ ├── -descriptor.html
│ │ └── index.html
│ │ ├── -characteristic
│ │ ├── -companion
│ │ │ ├── -a-p-p-e-a-r-a-n-c-e.html
│ │ │ ├── -d-e-v-i-c-e_-n-a-m-e.html
│ │ │ ├── -p-e-r-i-p-h-e-r-a-l_-p-r-e-f-e-r-r-e-d_-c-o-n-n-e-c-t-i-o-n_-p-a-r-a-m-e-t-e-r-s.html
│ │ │ ├── -p-e-r-i-p-h-e-r-a-l_-p-r-i-v-a-c-y_-f-l-a-g.html
│ │ │ ├── -r-e-c-o-n-n-e-c-t-i-o-n_-a-d-d-r-e-s-s.html
│ │ │ ├── -s-e-r-v-i-c-e_-c-h-a-n-g-e-d.html
│ │ │ └── index.html
│ │ ├── descriptors.html
│ │ ├── index.html
│ │ ├── instance-id.html
│ │ ├── owner.html
│ │ ├── properties.html
│ │ ├── service.html
│ │ └── uuid.html
│ │ ├── -connection-parameters
│ │ ├── -connected
│ │ │ ├── -connected.html
│ │ │ ├── connection-interval-millis.html
│ │ │ ├── connection-interval.html
│ │ │ ├── index.html
│ │ │ ├── slave-latency.html
│ │ │ ├── supervision-timeout-millis.html
│ │ │ ├── supervision-timeout.html
│ │ │ └── to-string.html
│ │ ├── -unknown
│ │ │ └── index.html
│ │ └── index.html
│ │ ├── -connection-state
│ │ ├── -closed
│ │ │ └── index.html
│ │ ├── -connected
│ │ │ └── index.html
│ │ ├── -connecting
│ │ │ └── index.html
│ │ ├── -disconnected
│ │ │ ├── -disconnected.html
│ │ │ ├── -reason
│ │ │ │ ├── -cancelled
│ │ │ │ │ └── index.html
│ │ │ │ ├── -link-loss
│ │ │ │ │ └── index.html
│ │ │ │ ├── -success
│ │ │ │ │ └── index.html
│ │ │ │ ├── -terminate-local-host
│ │ │ │ │ └── index.html
│ │ │ │ ├── -terminate-peer-user
│ │ │ │ │ └── index.html
│ │ │ │ ├── -timeout
│ │ │ │ │ ├── -timeout.html
│ │ │ │ │ ├── duration.html
│ │ │ │ │ └── index.html
│ │ │ │ ├── -unknown
│ │ │ │ │ ├── -unknown.html
│ │ │ │ │ ├── index.html
│ │ │ │ │ └── status.html
│ │ │ │ ├── -unsupported-address
│ │ │ │ │ └── index.html
│ │ │ │ └── index.html
│ │ │ ├── index.html
│ │ │ └── reason.html
│ │ ├── -disconnecting
│ │ │ └── index.html
│ │ ├── index.html
│ │ ├── is-connected.html
│ │ └── is-disconnected.html
│ │ ├── -descriptor
│ │ ├── -companion
│ │ │ ├── -c-h-a-r_-a-g-g-r-e-g-a-t-e_-f-o-r-m-a-t_-u-u-i-d.html
│ │ │ ├── -c-h-a-r_-e-x-t_-p-r-o-p_-u-u-i-d.html
│ │ │ ├── -c-h-a-r_-p-r-e-s-e-n-t-a-t-i-o-n_-f-o-r-m-a-t_-u-u-i-d.html
│ │ │ ├── -c-h-a-r_-u-s-e-r_-d-e-s-c_-u-u-i-d.html
│ │ │ ├── -c-l-i-e-n-t_-c-h-a-r_-c-o-n-f_-u-u-i-d.html
│ │ │ ├── -s-e-r-v-e-r_-c-h-a-r_-c-o-n-f_-u-u-i-d.html
│ │ │ └── index.html
│ │ ├── characteristic.html
│ │ ├── index.html
│ │ ├── instance-id.html
│ │ ├── is-client-characteristic-configuration.html
│ │ ├── owner.html
│ │ └── uuid.html
│ │ ├── -included-service
│ │ ├── index.html
│ │ ├── owner.html
│ │ └── service.html
│ │ ├── -legacy-advertising-set-parameters
│ │ ├── -legacy-advertising-set-parameters.html
│ │ └── index.html
│ │ ├── -manager
│ │ ├── -state
│ │ │ ├── -p-o-w-e-r-e-d_-o-f-f
│ │ │ │ └── index.html
│ │ │ ├── -p-o-w-e-r-e-d_-o-n
│ │ │ │ └── index.html
│ │ │ ├── -r-e-s-e-t-t-i-n-g
│ │ │ │ └── index.html
│ │ │ ├── -u-n-k-n-o-w-n
│ │ │ │ └── index.html
│ │ │ ├── -u-n-s-u-p-p-o-r-t-e-d
│ │ │ │ └── index.html
│ │ │ ├── entries.html
│ │ │ ├── index.html
│ │ │ ├── value-of.html
│ │ │ └── values.html
│ │ ├── index.html
│ │ └── state.html
│ │ ├── -operation-status
│ │ ├── -b-u-s-y
│ │ │ └── index.html
│ │ ├── -c-o-n-n-e-c-t-i-o-n_-c-o-n-g-e-s-t-e-d
│ │ │ └── index.html
│ │ ├── -g-a-t-t_-e-r-r-o-r
│ │ │ └── index.html
│ │ ├── -i-n-s-u-f-f-i-c-i-e-n-t_-a-u-t-h-e-n-t-i-c-a-t-i-o-n
│ │ │ └── index.html
│ │ ├── -i-n-s-u-f-f-i-c-i-e-n-t_-a-u-t-h-o-r-i-z-a-t-i-o-n
│ │ │ └── index.html
│ │ ├── -i-n-s-u-f-f-i-c-i-e-n-t_-e-n-c-r-y-p-t-i-o-n
│ │ │ └── index.html
│ │ ├── -i-n-v-a-l-i-d_-a-t-t-r-i-b-u-t-e_-l-e-n-g-t-h
│ │ │ └── index.html
│ │ ├── -i-n-v-a-l-i-d_-o-f-f-s-e-t
│ │ │ └── index.html
│ │ ├── -r-e-a-d_-n-o-t_-p-e-r-m-i-t-t-e-d
│ │ │ └── index.html
│ │ ├── -r-e-q-u-e-s-t_-n-o-t_-s-u-p-p-o-r-t-e-d
│ │ │ └── index.html
│ │ ├── -s-u-b-s-c-r-i-b-e_-n-o-t_-p-e-r-m-i-t-t-e-d
│ │ │ └── index.html
│ │ ├── -s-u-c-c-e-s-s
│ │ │ └── index.html
│ │ ├── -u-n-k-n-o-w-n_-e-r-r-o-r
│ │ │ └── index.html
│ │ ├── -w-r-i-t-e_-n-o-t_-p-e-r-m-i-t-t-e-d
│ │ │ └── index.html
│ │ ├── entries.html
│ │ ├── index.html
│ │ ├── is-success.html
│ │ ├── to-string.html
│ │ ├── value-of.html
│ │ └── values.html
│ │ ├── -peer
│ │ ├── identifier.html
│ │ └── index.html
│ │ ├── -peripheral-type
│ │ ├── -c-l-a-s-s-i-c
│ │ │ └── index.html
│ │ ├── -d-u-a-l
│ │ │ └── index.html
│ │ ├── -l-e
│ │ │ └── index.html
│ │ ├── -u-n-k-n-o-w-n
│ │ │ └── index.html
│ │ ├── entries.html
│ │ ├── index.html
│ │ ├── value-of.html
│ │ └── values.html
│ │ ├── -permission
│ │ ├── -p-e-r-m-i-s-s-i-o-n_-w-r-i-t-e_-s-i-g-n-e-d_-m-i-t-m
│ │ │ └── index.html
│ │ ├── -r-e-a-d
│ │ │ └── index.html
│ │ ├── -r-e-a-d_-e-n-c-r-y-p-t-e-d
│ │ │ └── index.html
│ │ ├── -r-e-a-d_-e-n-c-r-y-p-t-e-d_-m-i-t-m
│ │ │ └── index.html
│ │ ├── -w-r-i-t-e
│ │ │ └── index.html
│ │ ├── -w-r-i-t-e_-e-n-c-r-y-p-t-e-d
│ │ │ └── index.html
│ │ ├── -w-r-i-t-e_-e-n-c-r-y-p-t-e-d_-m-i-t-m
│ │ │ └── index.html
│ │ ├── -w-r-i-t-e_-s-i-g-n-e-d
│ │ │ └── index.html
│ │ ├── entries.html
│ │ ├── index.html
│ │ ├── value-of.html
│ │ └── values.html
│ │ ├── -phy-in-use
│ │ ├── -companion
│ │ │ ├── -p-h-y_-l-e_1-m.html
│ │ │ └── index.html
│ │ ├── -phy-in-use.html
│ │ ├── index.html
│ │ ├── rx-phy.html
│ │ ├── to-string.html
│ │ └── tx-phy.html
│ │ ├── -phy-option
│ │ ├── -n-o_-p-r-e-f-e-r-r-e-d
│ │ │ └── index.html
│ │ ├── -s2
│ │ │ └── index.html
│ │ ├── -s8
│ │ │ └── index.html
│ │ ├── entries.html
│ │ ├── index.html
│ │ ├── value-of.html
│ │ └── values.html
│ │ ├── -phy
│ │ ├── -p-h-y_-l-e_-c-o-d-e-d
│ │ │ └── index.html
│ │ ├── -p-h-y_-l-e_1-m
│ │ │ └── index.html
│ │ ├── -p-h-y_-l-e_2-m
│ │ │ └── index.html
│ │ ├── entries.html
│ │ ├── index.html
│ │ ├── to-string.html
│ │ ├── value-of.html
│ │ └── values.html
│ │ ├── -primary-phy
│ │ ├── -p-h-y_-l-e_-c-o-d-e-d
│ │ │ └── index.html
│ │ ├── -p-h-y_-l-e_1-m
│ │ │ └── index.html
│ │ ├── entries.html
│ │ ├── index.html
│ │ ├── to-string.html
│ │ ├── value-of.html
│ │ └── values.html
│ │ ├── -primary-service
│ │ └── index.html
│ │ ├── -server-scope
│ │ ├── -service.html
│ │ └── index.html
│ │ ├── -service-scope
│ │ ├── -characteristic.html
│ │ ├── -included-service.html
│ │ └── index.html
│ │ ├── -service
│ │ ├── -companion
│ │ │ ├── -g-e-n-e-r-i-c_-a-c-c-e-s-s_-u-u-i-d.html
│ │ │ ├── -g-e-n-e-r-i-c_-a-t-t-r-i-b-u-t-e_-u-u-i-d.html
│ │ │ └── index.html
│ │ ├── characteristics.html
│ │ ├── included-services.html
│ │ ├── index.html
│ │ ├── instance-id.html
│ │ └── uuid.html
│ │ ├── -tx-power-level
│ │ ├── -h-i-g-h.html
│ │ ├── -l-o-w.html
│ │ ├── -m-e-d-i-u-m.html
│ │ ├── -u-l-t-r-a_-l-o-w.html
│ │ └── index.html
│ │ ├── -write-type
│ │ ├── -s-i-g-n-e-d
│ │ │ └── index.html
│ │ ├── -w-i-t-h-o-u-t_-r-e-s-p-o-n-s-e
│ │ │ └── index.html
│ │ ├── -w-i-t-h_-r-e-s-p-o-n-s-e
│ │ │ └── index.html
│ │ ├── entries.html
│ │ ├── index.html
│ │ ├── required-property.html
│ │ ├── value-of.html
│ │ └── values.html
│ │ ├── and.html
│ │ ├── as-flags.html
│ │ ├── default-write-type.html
│ │ ├── index.html
│ │ └── value.html
│ ├── images
│ ├── anchor-copy-button.svg
│ ├── copy-icon.svg
│ ├── copy-successful-icon.svg
│ ├── footer-go-to-link.svg
│ ├── go-to-top-icon.svg
│ └── logo-icon.svg
│ ├── index.html
│ ├── navigation.html
│ ├── package-list
│ ├── scripts
│ ├── clipboard.js
│ ├── main.js
│ ├── navigation-loader.js
│ ├── pages.json
│ ├── platform-content-handler.js
│ ├── prism.js
│ ├── sourceset_dependencies.js
│ └── symbol-parameters-wrapper_deferred.js
│ ├── styles
│ ├── font-jb-sans-auto.css
│ ├── logo-styles.css
│ ├── main.css
│ ├── prism.css
│ └── style.css
│ └── ui-kit
│ ├── assets
│ ├── abstract-class-kotlin.svg
│ ├── abstract-class.svg
│ ├── annotation-kotlin.svg
│ ├── annotation.svg
│ ├── arrow-down.svg
│ ├── burger.svg
│ ├── checkbox-off.svg
│ ├── checkbox-on.svg
│ ├── class-kotlin.svg
│ ├── class.svg
│ ├── cross.svg
│ ├── enum-kotlin.svg
│ ├── enum.svg
│ ├── exception-class.svg
│ ├── field-value.svg
│ ├── field-variable.svg
│ ├── filter.svg
│ ├── function.svg
│ ├── homepage.svg
│ ├── interface-kotlin.svg
│ ├── interface.svg
│ ├── object.svg
│ ├── placeholder.svg
│ ├── theme-toggle.svg
│ └── typealias-kotlin.svg
│ ├── ui-kit.min.css
│ └── ui-kit.min.js
├── fastlane
├── Appfile
└── Fastfile
├── gradle.properties
├── gradle
├── libs.versions.toml
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── profile
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── no
│ └── nordicsemi
│ └── android
│ └── kotlin
│ └── ble
│ └── profile
│ ├── battery
│ └── BatteryLevelParser.kt
│ ├── bps
│ ├── BloodPressureMeasurementParser.kt
│ ├── IntermediateCuffPressureParser.kt
│ └── data
│ │ ├── BPMStatus.kt
│ │ ├── BloodPressureMeasurementData.kt
│ │ ├── BloodPressureType.kt
│ │ └── IntermediateCuffPressureData.kt
│ ├── cgm
│ ├── CGMFeatureParser.kt
│ ├── CGMMeasurementParser.kt
│ ├── CGMSpecificOpsControlPointParser.kt
│ ├── CGMStatusParser.kt
│ └── data
│ │ ├── CGMCalibrationStatus.kt
│ │ ├── CGMErrorCode.kt
│ │ ├── CGMFeatures.kt
│ │ ├── CGMOpCode.kt
│ │ ├── CGMRecord.kt
│ │ ├── CGMSpecificOpsControlPointData.kt
│ │ └── CGMStatus.kt
│ ├── common
│ ├── CRC16.kt
│ └── MutableData.kt
│ ├── csc
│ ├── CSCDataParser.kt
│ └── data
│ │ ├── CSCData.kt
│ │ ├── CSCDataSnapshot.kt
│ │ └── WheelSize.kt
│ ├── date
│ └── DateTimeParser.kt
│ ├── gls
│ ├── CGMSpecificOpsControlPointDataParser.kt
│ ├── GlucoseMeasurementContextParser.kt
│ ├── GlucoseMeasurementParser.kt
│ ├── RecordAccessControlPointInputParser.kt
│ ├── RecordAccessControlPointParser.kt
│ └── data
│ │ ├── Carbohydrate.kt
│ │ ├── GLSData.kt
│ │ ├── GLSRecord.kt
│ │ ├── GlucoseMeasurementUnit.kt
│ │ ├── GlucoseStatus.kt
│ │ ├── Health.kt
│ │ ├── Meal.kt
│ │ ├── Medication.kt
│ │ ├── RecordAccessControlPointData.kt
│ │ ├── RequestStatus.kt
│ │ └── Tester.kt
│ ├── hrs
│ ├── BodySensorLocationParser.kt
│ ├── HRSDataParser.kt
│ └── data
│ │ └── HRSData.kt
│ ├── hts
│ ├── HTSDataParser.kt
│ └── data
│ │ ├── HTSData.kt
│ │ └── TemperatureUnit.kt
│ ├── prx
│ ├── AlarmLevel.kt
│ ├── AlarmLevelParser.kt
│ ├── AlertLevelInputParser.kt
│ └── PRXData.kt
│ ├── racp
│ ├── RACPOpCode.kt
│ └── RACPResponseCode.kt
│ └── rscs
│ ├── RSCSDataParser.kt
│ └── data
│ └── RSCSData.kt
├── renovate.json
├── sample
├── .gitignore
├── build.gradle.kts
├── proguard-rules.pro
└── src
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── no
│ │ │ └── nordicsemi
│ │ │ └── kotlin
│ │ │ └── ble
│ │ │ └── android
│ │ │ └── sample
│ │ │ ├── MainActivity.kt
│ │ │ ├── TestApplication.kt
│ │ │ ├── advertiser
│ │ │ ├── AdvertiserView.kt
│ │ │ └── AdvertiserViewModel.kt
│ │ │ ├── common
│ │ │ ├── DeviceActions.kt
│ │ │ ├── DeviceList.kt
│ │ │ └── DeviceServices.kt
│ │ │ ├── menu
│ │ │ └── MenuScreen.kt
│ │ │ ├── scanner
│ │ │ ├── ScannerScreen.kt
│ │ │ └── ScannerViewModel.kt
│ │ │ ├── util
│ │ │ └── CloseableCoroutineScope.kt
│ │ │ └── view
│ │ │ ├── ExposedDropdownMenu.kt
│ │ │ ├── LabeledSwitch.kt
│ │ │ └── Title.kt
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.webp
│ │ └── ic_launcher_round.webp
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── themes.xml
│ ├── mock
│ └── java
│ │ └── no
│ │ └── nordicsemi
│ │ └── kotlin
│ │ └── ble
│ │ └── android
│ │ └── sample
│ │ ├── advertiser
│ │ └── AdvertiserScreen.kt
│ │ └── di
│ │ ├── SdkModule.kt
│ │ └── ViewModelModule.kt
│ └── native
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── android
│ └── sample
│ ├── advertiser
│ └── AdvertiserScreen.kt
│ └── di
│ ├── SdkModule.kt
│ └── ViewModelModule.kt
├── server-android-mock
├── build.gradle.kts
└── src
│ └── main
│ └── AndroidManifest.xml
├── server-android
├── build.gradle.kts
└── src
│ └── main
│ └── AndroidManifest.xml
├── server-core-android
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── server
│ └── android
│ ├── Central.kt
│ ├── ConnectionEvent.kt
│ └── PeripheralManager.kt
├── server-core
├── build.gradle.kts
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── no
│ └── nordicsemi
│ └── kotlin
│ └── ble
│ └── server
│ ├── Central.kt
│ ├── LocalCharacteristic.kt
│ ├── LocalDescriptor.kt
│ ├── LocalService.kt
│ ├── PeripheralManager.kt
│ └── internal
│ └── PeripheralManagerImpl.kt
├── settings.gradle.kts
└── test
├── build.gradle.kts
├── consumer-rules.pro
├── proguard-rules.pro
└── src
├── androidTest
└── java
│ └── no
│ └── nordicsemi
│ └── android
│ └── kotlin
│ └── ble
│ └── test
│ ├── BluetoothGattServiceFactoryTest.kt
│ ├── DeadlockTwoDevices.kt
│ ├── ExampleInstrumentedTest.kt
│ ├── GetNotificationsStuckTest.kt
│ ├── MutexTest.kt
│ ├── ReadFromDisconnectedDeviceTest.kt
│ ├── SimultaneousRssiStuckTest.kt
│ ├── WithTimeoutTest.kt
│ └── utils
│ ├── BlinkySpecifications.kt
│ └── TestAddressProvider.kt
├── main
└── AndroidManifest.xml
└── test
└── java
└── no
└── nordicsemi
└── android
└── kotlin
└── ble
└── test
├── ApplicationScopeModule.kt
├── BlinkyServerProvider.kt
├── BlinkySpecifications.kt
├── DevicesModule.kt
├── LocalMutexTest.kt
├── ReliableWriteServerProvider.kt
├── ReliableWriteTest.kt
├── WithTimeoutTest.kt
├── WriteNoResponseServer.kt
└── WriteNoResponseTest.kt
/.github/workflows/deploy-to-nexus.yml:
--------------------------------------------------------------------------------
1 | name: Deploy to Nexus
2 | on:
3 | push:
4 | tags:
5 | - '*'
6 | workflow_dispatch:
7 | jobs:
8 | deployToNexus:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - uses: actions/checkout@v4
12 | with:
13 | fetch-depth: 0
14 | - uses: actions/setup-java@v4
15 | with:
16 | distribution: 'jetbrains'
17 | java-version: '21'
18 | - shell: bash
19 | env:
20 | # The following env variables are used by gradle/publish-module.gradle
21 | GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
22 | GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
23 | # The following env variables are used by gradle/publish-root.gradle.kts
24 | OSSR_USERNAME: ${{ secrets.OSSR_USERNAME }}
25 | OSSR_PASSWORD: ${{ secrets.OSSR_PASSWORD }}
26 | SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
27 | # The script generates sec.gpg file that is required by gradle/publish-module.gradle
28 | # and starts :deployNexus lane using fastlane.
29 | run: |
30 | java --version
31 | echo "${{ secrets.GPG_FILE }}" > sec.gpg.asc
32 | gpg -d --passphrase "${{ secrets.GPG_FILE_PSWD }}" --batch sec.gpg.asc > sec.gpg
33 | fastlane deployNexus
34 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | gem "fastlane"
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2024, Nordic Semiconductor
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | 1. Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | 2. Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | 3. Neither the name of the copyright holder nor the names of its
15 | contributors may be used to endorse or promote products derived from
16 | this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/advertiser-android-mock/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/advertiser-android-mock/Module.md:
--------------------------------------------------------------------------------
1 | # Module advertiser-android-mock
2 |
3 | A mock implementation for the Bluetooth Low Energy advertiser on Android.
4 |
5 | This module provides a mock version of the Bluetooth LE advertiser, which can be used for testing
6 | purposes without requiring actual Bluetooth hardware.
7 |
8 | # Package no.nordicsemi.kotlin.ble.advertiser.android.mock
9 |
10 | This package contains a Factory method to create a mock Android implementation for the Bluetooth LE Advertiser.
--------------------------------------------------------------------------------
/advertiser-android/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/advertiser-android/Module.md:
--------------------------------------------------------------------------------
1 | # Module advertiser-android
2 |
3 | Android implementation for the Bluetooth Low Energy advertiser.
4 |
5 | # Package no.nordicsemi.kotlin.ble.advertiser.android
6 |
7 | This package contains a Factory method to create an Android implementation for the Bluetooth LE Advertiser.
--------------------------------------------------------------------------------
/advertiser-android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/advertiser-core-android/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/advertiser-core-android/Module.md:
--------------------------------------------------------------------------------
1 | # Module advertiser-core-android
2 |
3 | Set of core classes providing the common functionality for Bluetooth Low Energy advertising on Android.
4 |
5 | # Package no.nordicsemi.kotlin.ble.advertiser.android
6 |
7 | This package contains the common Android implementation for the Bluetooth LE Advertiser functionality,
8 | used by the Android native and mock implementations.
--------------------------------------------------------------------------------
/advertiser-core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/advertiser-core/Module.md:
--------------------------------------------------------------------------------
1 | # Module advertiser-core
2 |
3 | Platform independent classes providing the core functionality for Bluetooth Low Energy advertising.
4 |
5 | # Package no.nordicsemi.kotlin.ble.advertiser
6 |
7 | This package contains the common interface for the Bluetooth LE Advertiser.
8 |
9 | # Package no.nordicsemi.kotlin.ble.advertiser.exception
10 |
11 | A package containing exceptions related to Bluetooth LE advertising operations.
--------------------------------------------------------------------------------
/client-android-mock/Module.md:
--------------------------------------------------------------------------------
1 | # Module client-android-mock
2 |
3 | Android implementation for the Bluetooth Low Energy mock client.
4 |
5 | This module provides the necessary classes and methods to interact with mock Bluetooth Low Energy (BLE)
6 | devices as a client on Android platforms, including emulating scanning, connecting and exchanging data.
7 |
8 | Mock implementations are useful for testing purposes without requiring actual BLE hardware.
9 |
10 | # Package no.nordicsemi.kotlin.ble.client.android.mock
11 |
12 | This package contains a Factory method to create a mock Android implementation for the Central Manager.
--------------------------------------------------------------------------------
/client-android-mock/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/client-android-mock/src/main/java/no/nordicsemi/kotlin/ble/client/android/mock/MockCentralManager.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.client.android.mock
33 |
34 | import no.nordicsemi.kotlin.ble.client.android.CentralManager
35 | import no.nordicsemi.kotlin.ble.client.mock.SimulationProvider
36 |
37 | /**
38 | * A mock central manager implementation for Android that can mock a real Central Manager.
39 | *
40 | * Use [simulatePeripherals] to set up mock peripherals.
41 | */
42 | interface MockCentralManager: CentralManager, SimulationProvider
--------------------------------------------------------------------------------
/client-android/Module.md:
--------------------------------------------------------------------------------
1 | # Module client-android
2 |
3 | Android implementation for the Bluetooth Low Energy GATT client.
4 |
5 | This module provides the necessary classes and methods to interact with Bluetooth Low Energy (BLE)
6 | devices as a client on Android platforms, including scanning, connecting and exchanging data.
7 |
8 | # Package no.nordicsemi.kotlin.ble.client.android
9 |
10 | This package contains a Factory method to create an Android implementation for the Central Manager.
--------------------------------------------------------------------------------
/client-android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/client-android/src/main/java/no/nordicsemi/kotlin/ble/client/android/internal/NativeOperationMutex.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.client.android.internal
33 |
34 | import kotlinx.coroutines.sync.Mutex
35 | import kotlinx.coroutines.sync.withLock
36 |
37 | /**
38 | * This mutex ensures that only one Bluetooth LE operation can be executed concurrently.
39 | */
40 | internal object NativeOperationMutex {
41 | private val lock = Mutex(locked = false)
42 |
43 | suspend fun withLock(block: suspend () -> T): T {
44 | return lock.withLock { block() }
45 | }
46 | }
--------------------------------------------------------------------------------
/client-core-android/Module.md:
--------------------------------------------------------------------------------
1 | # Module client-core-android
2 |
3 | Common Android types and interfaces for Bluetooth Low Energy clients.
4 |
5 | This module is used by by native and mock implementations on Android.
6 |
7 | # Package no.nordicsemi.kotlin.ble.client.android
8 |
9 | Common types and interfaces for Bluetooth Low Energy clients related to Android-specific API.
10 |
11 | # Package no.nordicsemi.kotlin.ble.client.android.exception
12 |
13 | This package contains exceptions that can be thrown by Android clients when scanning or interacting
14 | with Bluetooth Low Energy devices.
15 |
16 | # Package no.nordicsemi.kotlin.ble.client.android.preview
17 |
18 | Types that can be user for Previews in Android Jetpack Compose whenever a Peripheral instance is
19 | required.
--------------------------------------------------------------------------------
/client-core-android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/client-core-android/src/main/java/no/nordicsemi/kotlin/ble/client/android/exception/BondingFailedException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.client.android.exception
33 |
34 | import no.nordicsemi.kotlin.ble.core.exception.BluetoothException
35 |
36 | class BondingFailedException: BluetoothException()
--------------------------------------------------------------------------------
/client-core-android/src/main/java/no/nordicsemi/kotlin/ble/client/android/exception/PeripheralClosedException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.client.android.exception
33 |
34 | import no.nordicsemi.kotlin.ble.core.exception.BluetoothException
35 | import no.nordicsemi.kotlin.ble.client.android.Peripheral
36 |
37 | /**
38 | * Thrown when the peripheral wasn't connected or has been closed.
39 | *
40 | * This exception is thrown from [Peripheral.refreshCache] when the underlying GATT
41 | * object is null..
42 | */
43 | class PeripheralClosedException: BluetoothException()
--------------------------------------------------------------------------------
/client-core/Module.md:
--------------------------------------------------------------------------------
1 | # Module client-core
2 |
3 | Common types and interfaces for Bluetooth Low Energy clients.
4 |
5 | This module is used by platform-specific implementations for native and mock environments.
6 |
7 | # Package no.nordicsemi.kotlin.ble.client
8 |
9 | Common types and interfaces for Bluetooth Low Energy clients.
10 |
11 | # Package no.nordicsemi.kotlin.ble.client.exception
12 |
13 | This package contains exceptions that can be thrown by the client when scanning or interacting with
14 | Bluetooth Low Energy devices.
--------------------------------------------------------------------------------
/client-core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/client-core/src/main/java/no/nordicsemi/kotlin/ble/client/exception/BluetoothUnavailableException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.client.exception
33 |
34 | import no.nordicsemi.kotlin.ble.core.exception.BluetoothException
35 |
36 | /**
37 | * Thrown when Bluetooth is disabled or unavailable on the device.
38 | */
39 | class BluetoothUnavailableException: BluetoothException("Bluetooth is disabled or unavailable")
--------------------------------------------------------------------------------
/client-core/src/main/java/no/nordicsemi/kotlin/ble/client/exception/ConnectionFailedException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | @file:Suppress("unused", "MemberVisibilityCanBePrivate")
33 |
34 | package no.nordicsemi.kotlin.ble.client.exception
35 |
36 | import no.nordicsemi.kotlin.ble.core.ConnectionState
37 | import no.nordicsemi.kotlin.ble.core.exception.GattException
38 |
39 | /**
40 | * Thrown when the connection to the peripheral has failed.
41 | *
42 | * @property reason The reason why the connection attempt failed.
43 | */
44 | class ConnectionFailedException(
45 | val reason: ConnectionState.Disconnected.Reason
46 | ): GattException("Connection failed, reason: $reason")
--------------------------------------------------------------------------------
/client-core/src/main/java/no/nordicsemi/kotlin/ble/client/exception/InvalidAttributeException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.client.exception
33 |
34 | import no.nordicsemi.kotlin.ble.core.exception.BluetoothException
35 |
36 | /**
37 | * Thrown when the attribute has been invalidated and cannot be used anymore.
38 | *
39 | * An attribute may be invalidated when the device has disconnected, the services
40 | * of the device have changed.
41 | */
42 | class InvalidAttributeException: BluetoothException("The attribute has been invalidated and cannot be used anymore")
--------------------------------------------------------------------------------
/client-core/src/main/java/no/nordicsemi/kotlin/ble/client/exception/OperationFailedException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.client.exception
33 |
34 | import no.nordicsemi.kotlin.ble.core.OperationStatus
35 | import no.nordicsemi.kotlin.ble.core.exception.GattException
36 |
37 | /**
38 | * Thrown when the GATT operation failed.
39 | *
40 | * @property reason The reason of the failure.
41 | */
42 | data class OperationFailedException(
43 | val reason: OperationStatus
44 | ): GattException("Operation failed, reason: $reason")
--------------------------------------------------------------------------------
/client-core/src/main/java/no/nordicsemi/kotlin/ble/client/exception/PeripheralNotConnectedException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | @file:Suppress("unused")
33 |
34 | package no.nordicsemi.kotlin.ble.client.exception
35 |
36 | import no.nordicsemi.kotlin.ble.core.exception.GattException
37 |
38 | /**
39 | * Thrown when the peripheral is not connected, or has disconnected during the operation.
40 | */
41 | class PeripheralNotConnectedException: GattException("Peripheral is not connected")
--------------------------------------------------------------------------------
/client-core/src/main/java/no/nordicsemi/kotlin/ble/client/exception/ScanningException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.client.exception
33 |
34 | import no.nordicsemi.kotlin.ble.core.exception.BluetoothException
35 |
36 | /**
37 | * Base class for scanning exceptions.
38 | */
39 | open class ScanningException: BluetoothException {
40 | constructor(): super("Scanning failed")
41 | constructor(message: String): super(message)
42 | }
--------------------------------------------------------------------------------
/client-core/src/main/java/no/nordicsemi/kotlin/ble/client/exception/ValueDoesNotMatchException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.client.exception
33 |
34 | import no.nordicsemi.kotlin.ble.core.exception.GattException
35 |
36 | /**
37 | * Thrown when the value reported by the remote device does not match the value sent
38 | * using Reliable Write operation.
39 | */
40 | class ValueDoesNotMatchException:
41 | GattException("The received value does not match the value sent using Reliable Write")
--------------------------------------------------------------------------------
/client-mock/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/client-mock/Module.md:
--------------------------------------------------------------------------------
1 | # Module client-mock
2 |
3 | Common types and interfaces for mock Bluetooth Low Energy clients.
4 |
5 | This module is used by platform-specific mock implementations.
6 |
7 | # Package no.nordicsemi.kotlin.ble.client.mock
8 |
9 | Common types and interfaces for mock Bluetooth Low Energy clients.
--------------------------------------------------------------------------------
/client-mock/src/main/java/no/nordicsemi/kotlin/ble/client/mock/DisconnectionReason.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | @file:Suppress("unused")
33 |
34 | package no.nordicsemi.kotlin.ble.client.mock
35 |
36 | sealed class DisconnectionReason
37 |
38 | data object TerminateLocalHost: DisconnectionReason()
39 |
40 | data object Timeout: DisconnectionReason()
--------------------------------------------------------------------------------
/core-android-mock/Module.md:
--------------------------------------------------------------------------------
1 | # Module core-android-mock
2 |
3 | Types for customizing mock environment on Android.
4 |
5 | # Package no.nordicsemi.kotlin.ble.android.mock
6 |
7 | This package contains a class for defining mock environment on Android.
--------------------------------------------------------------------------------
/core-android-mock/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/core-android/Module.md:
--------------------------------------------------------------------------------
1 | # Module core-android
2 |
3 | Core types and interfaces for Bluetooth Low Energy clients and server implementations on Android.
4 |
5 | # Package no.nordicsemi.kotlin.ble.core.android
6 |
7 | Core types and interfaces for Bluetooth Low Energy clients and server implementations on Android.
--------------------------------------------------------------------------------
/core-android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/core-mock/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/core-mock/Module.md:
--------------------------------------------------------------------------------
1 | # Module core-mock
2 |
3 | Core types for defining mock environments.
4 |
5 | # Package no.nordicsemi.kotlin.ble.core.mock
6 |
7 | This package contains classes for defining mock environments.
--------------------------------------------------------------------------------
/core-mock/src/main/java/no/nordicsemi/kotlin/ble/core/mock/MockEnvironment.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.core.mock
33 |
34 | /**
35 | * A mock environment that can be used to test the behavior of the Central Manager.
36 | *
37 | * @property deviceName The device local device name.
38 | * @property isBluetoothSupported Whether Bluetooth is supported on the device.
39 | * @property isBluetoothEnabled Whether Bluetooth is enabled.
40 | */
41 | open class MockEnvironment(
42 | var deviceName: String,
43 | val isBluetoothSupported: Boolean,
44 | val isBluetoothEnabled: Boolean,
45 | )
--------------------------------------------------------------------------------
/core/Module.md:
--------------------------------------------------------------------------------
1 | # Module core
2 |
3 | Core types and interfaces for Bluetooth Low Energy clients and server implementations.
4 |
5 | # Package no.nordicsemi.kotlin.ble.core
6 |
7 | Core types and interfaces for Bluetooth Low Energy clients and server implementations.
8 |
9 | # Package no.nordicsemi.kotlin.ble.exception
10 |
11 | Generic Bluetooth Low Energy exceptions.
12 |
13 | # Package no.nordicsemi.kotlin.ble.util
14 |
15 | Utilities.
--------------------------------------------------------------------------------
/core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/core/src/main/java/no/nordicsemi/kotlin/ble/core/AdvertisingDataDefinition.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | @file:Suppress("unused")
33 |
34 | package no.nordicsemi.kotlin.ble.core
35 |
36 | import kotlin.uuid.ExperimentalUuidApi
37 | import kotlin.uuid.Uuid
38 |
39 | /**
40 | * Advertising data packet container for Bluetooth LE advertising.
41 | *
42 | * This represents the data to be advertised in the Advertising Data as well as the Scan Response
43 | * data.
44 | *
45 | * @param serviceUuids A list of service UUID to advertise.
46 | */
47 | @OptIn(ExperimentalUuidApi::class)
48 | open class AdvertisingDataDefinition(
49 | val serviceUuids: List? = null,
50 | )
--------------------------------------------------------------------------------
/core/src/main/java/no/nordicsemi/kotlin/ble/core/BondState.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | @file:Suppress("unused")
33 |
34 | package no.nordicsemi.kotlin.ble.core
35 |
36 | /**
37 | * Defines available bonding states.
38 | */
39 | enum class BondState {
40 | /** Device is not bonded and bonding process has not been initiated. */
41 | NONE,
42 | /** Device is not bonded, but bonding process has been initiated. */
43 | BONDING,
44 | /** Device is bonded. */
45 | BONDED
46 | }
47 |
--------------------------------------------------------------------------------
/core/src/main/java/no/nordicsemi/kotlin/ble/core/GattConstants.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.core
33 |
34 | /** The default ATT MTU size. */
35 | const val ATT_MTU_DEFAULT = 23
36 | /** The maximum ATT MTU size. */
37 | const val ATT_MTU_MAX = 517
--------------------------------------------------------------------------------
/core/src/main/java/no/nordicsemi/kotlin/ble/core/Peer.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | @file:Suppress("unused")
33 |
34 | package no.nordicsemi.kotlin.ble.core
35 |
36 | /**
37 | * Class representing a Bluetooth LE peer device or a mock.
38 | *
39 | * @property identifier A platform-specific unique device identifier.
40 | */
41 | interface Peer {
42 | val identifier: ID
43 | }
--------------------------------------------------------------------------------
/core/src/main/java/no/nordicsemi/kotlin/ble/core/PeripheralType.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | @file:Suppress("unused")
33 |
34 | package no.nordicsemi.kotlin.ble.core
35 |
36 | /**
37 | * The Bluetooth device type of the remote device.
38 | */
39 | enum class PeripheralType {
40 | /**
41 | * The peripheral is a Classic - BR/EDR devices.
42 | */
43 | CLASSIC,
44 |
45 | /**
46 | * The peripheral is a Low-Energy-only device.
47 | */
48 | LE,
49 |
50 | /**
51 | * The peripheral supports both Classic and Low-Energy (BR/EDR/LE).
52 | */
53 | DUAL,
54 |
55 | /**
56 | * The peripheral type is unknown.
57 | */
58 | UNKNOWN
59 | }
--------------------------------------------------------------------------------
/core/src/main/java/no/nordicsemi/kotlin/ble/core/PhyInUse.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | @file:Suppress("unused")
33 |
34 | package no.nordicsemi.kotlin.ble.core
35 |
36 | /**
37 | * A class that holds the PHYs in use for a connection.
38 | *
39 | * @property txPhy The transmitter PHY in use.
40 | * @property rxPhy The receiver PHY in use.
41 | */
42 | data class PhyInUse(
43 | val txPhy: Phy,
44 | val rxPhy: Phy,
45 | ) {
46 |
47 | companion object {
48 | /**
49 | * A constant for legacy LE 1M PHY.
50 | */
51 | val PHY_LE_1M = PhyInUse(Phy.PHY_LE_1M, Phy.PHY_LE_1M)
52 | }
53 | override fun toString(): String {
54 | return "TX PHY=$txPhy, RX PHY=$rxPhy"
55 | }
56 | }
--------------------------------------------------------------------------------
/core/src/main/java/no/nordicsemi/kotlin/ble/core/exception/BluetoothException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.core.exception
33 |
34 | /**
35 | * Base class for all Bluetooth exceptions.
36 | */
37 | open class BluetoothException: IllegalStateException {
38 | constructor(): super()
39 | constructor(message: String): super(message)
40 | constructor(throwable: Throwable): super(throwable)
41 | constructor(message: String, throwable: Throwable): super(message, throwable)
42 | }
--------------------------------------------------------------------------------
/core/src/main/java/no/nordicsemi/kotlin/ble/core/exception/GattException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.core.exception
33 |
34 | /**
35 | * Base class for all GATT exceptions.
36 | */
37 | open class GattException: Exception {
38 | constructor(): super("GATT error")
39 | constructor(message: String): super(message)
40 | }
--------------------------------------------------------------------------------
/core/src/main/java/no/nordicsemi/kotlin/ble/core/exception/ManagerClosedException.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | @file:Suppress("unused")
33 |
34 | package no.nordicsemi.kotlin.ble.core.exception
35 |
36 | import no.nordicsemi.kotlin.ble.core.Manager
37 |
38 | /**
39 | * Thrown when an operation is requested on a [Manager] that has been closed.
40 | */
41 | class ManagerClosedException: IllegalStateException("Manager is closed")
--------------------------------------------------------------------------------
/core/src/main/java/no/nordicsemi/kotlin/ble/core/util/Distinct.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | @file:Suppress("unused")
33 |
34 | package no.nordicsemi.kotlin.ble.core.util
35 |
36 | import kotlinx.coroutines.flow.Flow
37 | import kotlinx.coroutines.flow.flow
38 | import no.nordicsemi.kotlin.ble.core.Peer
39 |
40 | /**
41 | * Returns a flow that emits only distinct peers.
42 | */
43 | fun > Flow.distinct(): Flow = flow {
44 | val set = mutableSetOf()
45 | collect { value ->
46 | if (set.add(value.identifier)) {
47 | emit(value)
48 | }
49 | }
50 | }
--------------------------------------------------------------------------------
/docs/html/images/anchor-copy-button.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/docs/html/images/copy-icon.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/docs/html/images/copy-successful-icon.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/docs/html/images/footer-go-to-link.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/docs/html/images/go-to-top-icon.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/docs/html/package-list:
--------------------------------------------------------------------------------
1 | $dokka.format:html-v1
2 | $dokka.linkExtension:html
3 |
4 | module:advertiser-android
5 | no.nordicsemi.kotlin.ble.advertiser.android
6 | module:advertiser-android-mock
7 | no.nordicsemi.kotlin.ble.advertiser.android.mock
8 | module:advertiser-core
9 | no.nordicsemi.kotlin.ble.advertiser
10 | no.nordicsemi.kotlin.ble.advertiser.exception
11 | module:advertiser-core-android
12 | no.nordicsemi.kotlin.ble.advertiser.android
13 | module:client-android
14 | no.nordicsemi.kotlin.ble.client.android
15 | module:client-android-mock
16 | no.nordicsemi.kotlin.ble.client.android.mock
17 | module:client-core
18 | no.nordicsemi.kotlin.ble.client
19 | no.nordicsemi.kotlin.ble.client.exception
20 | no.nordicsemi.kotlin.ble.client.internal
21 | module:client-core-android
22 | no.nordicsemi.kotlin.ble.client.android
23 | no.nordicsemi.kotlin.ble.client.android.exception
24 | no.nordicsemi.kotlin.ble.client.android.preview
25 | module:client-mock
26 | no.nordicsemi.kotlin.ble.client.mock
27 | no.nordicsemi.kotlin.ble.client.mock.internal
28 | module:core
29 | no.nordicsemi.kotlin.ble.core
30 | no.nordicsemi.kotlin.ble.core.exception
31 | no.nordicsemi.kotlin.ble.core.util
32 | module:core-android
33 | no.nordicsemi.kotlin.ble.core.android
34 | module:core-android-mock
35 | no.nordicsemi.kotlin.ble.android.mock
36 | module:core-mock
37 | no.nordicsemi.kotlin.ble.core.mock
38 | no.nordicsemi.kotlin.ble.core.mock.internal
39 |
--------------------------------------------------------------------------------
/docs/html/scripts/clipboard.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 |
5 | window.addEventListener('load', () => {
6 | document.querySelectorAll('span.copy-icon').forEach(element => {
7 | element.addEventListener('click', (el) => copyElementsContentToClipboard(element));
8 | })
9 |
10 | document.querySelectorAll('span.anchor-icon').forEach(element => {
11 | element.addEventListener('click', (el) => {
12 | if(element.hasAttribute('pointing-to')){
13 | const location = hrefWithoutCurrentlyUsedAnchor() + '#' + element.getAttribute('pointing-to')
14 | copyTextToClipboard(element, location)
15 | }
16 | });
17 | })
18 | })
19 |
20 | const copyElementsContentToClipboard = (element) => {
21 | const selection = window.getSelection();
22 | const range = document.createRange();
23 | range.selectNodeContents(element.parentNode.parentNode);
24 | selection.removeAllRanges();
25 | selection.addRange(range);
26 |
27 | copyAndShowPopup(element, () => selection.removeAllRanges())
28 | }
29 |
30 | const copyTextToClipboard = (element, text) => {
31 | var textarea = document.createElement("textarea");
32 | textarea.textContent = text;
33 | textarea.style.position = "fixed";
34 | document.body.appendChild(textarea);
35 | textarea.select();
36 |
37 | copyAndShowPopup(element, () => document.body.removeChild(textarea))
38 | }
39 |
40 | const copyAndShowPopup = (element, after) => {
41 | try {
42 | document.execCommand('copy');
43 | element.nextElementSibling.classList.add('active-popup');
44 | setTimeout(() => {
45 | element.nextElementSibling.classList.remove('active-popup');
46 | }, 1200);
47 | } catch (e) {
48 | console.error('Failed to write to clipboard:', e)
49 | }
50 | finally {
51 | if(after) after()
52 | }
53 | }
54 |
55 | const hrefWithoutCurrentlyUsedAnchor = () => window.location.href.split('#')[0]
56 |
57 |
--------------------------------------------------------------------------------
/docs/html/scripts/sourceset_dependencies.js:
--------------------------------------------------------------------------------
1 | sourceset_dependencies = '{":advertiser-android-mock/main":[],":client-core-android/main":[],":core-android/main":[],":client-mock/main":[],":core/main":[],":advertiser-android/debug":[],":advertiser-android/main":[],":advertiser-android/release":[],":core-android-mock/main":[],":advertiser-core-android/main":[],":client-core/main":[],":client-android/debug":[],":client-android/main":[],":client-android/release":[],":client-android-mock/main":[],":advertiser-core/main":[],":core-mock/main":[]}'
--------------------------------------------------------------------------------
/docs/html/styles/font-jb-sans-auto.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3 | */
4 |
5 | /* Light weight */
6 | @font-face {
7 | font-family: 'JetBrains Sans';
8 | src: url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-Light.woff2') format('woff2'), url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-Light.woff') format('woff');
9 | font-weight: 300;
10 | font-style: normal;
11 | font-display: swap;
12 | }
13 | /* Regular weight */
14 | @font-face {
15 | font-family: 'JetBrains Sans';
16 | src: url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-Regular.woff2') format('woff2'), url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-Regular.woff') format('woff');
17 | font-weight: 400;
18 | font-style: normal;
19 | font-display: swap;
20 | }
21 | /* SemiBold weight */
22 | @font-face {
23 | font-family: 'JetBrains Sans';
24 | src: url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-SemiBold.woff2') format('woff2'), url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans-SemiBold.woff') format('woff');
25 | font-weight: 600;
26 | font-style: normal;
27 | font-display: swap;
28 | }
29 |
30 | @supports (font-variation-settings: normal) {
31 | @font-face {
32 | font-family: 'JetBrains Sans';
33 | src: url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans.woff2') format('woff2 supports variations'),
34 | url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans.woff2') format('woff2-variations'),
35 | url('https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans.woff') format('woff-variations');
36 | font-weight: 100 900;
37 | font-style: normal;
38 | font-display: swap;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/docs/html/styles/logo-styles.css:
--------------------------------------------------------------------------------
1 | :root {
2 | /* Navigation bar */
3 | --dokka-logo-image-url: url(../images/logo-icon.svg);
4 | --dokka-logo-height: 120px;
5 | --dokka-logo-width: 120px;
6 |
7 | --color-background-nav: #00A9CE !important;
8 | --color-background-nav-dt: #333f48 !important;
9 |
10 | /* Selected menu */
11 | --color-key-blue: #00A9CE !important;
12 |
13 | /* Tabs */
14 | --active-section-color: #0077C8;
15 | --sidemenu-section-active-color: #0077C8;
16 | --active-tab-border-color: #0077C8;
17 | --hover-link-color: #0077C8;
18 |
19 | .toc--part[data-active]>.toc--row .toc--button:hover, .toc--part[data-active]>.toc--row .toc--link:hover {
20 | background-color: #2fb9df;
21 | }
22 | .sidebar {
23 | border-right: 1px solid rgba(39, 40, 44, .2);
24 | box-sizing: border-box;
25 | overflow: auto;
26 | width: var(--sidebar-width);
27 | background-color: #35414622;
28 | }
29 |
30 | }
31 |
32 | .theme-dark {
33 | --active-section-color: #00A9CE;
34 | --sidemenu-section-active-color: #00A9CE;
35 | --active-tab-border-color: #00A9CE;
36 | --hover-link-color: #00A9CE;
37 | }
38 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/abstract-class-kotlin.svg:
--------------------------------------------------------------------------------
1 |
4 |
5 |
27 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/abstract-class.svg:
--------------------------------------------------------------------------------
1 |
4 |
23 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/annotation-kotlin.svg:
--------------------------------------------------------------------------------
1 |
4 |
5 |
14 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/annotation.svg:
--------------------------------------------------------------------------------
1 |
4 |
10 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/arrow-down.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/burger.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/checkbox-off.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/checkbox-on.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/class-kotlin.svg:
--------------------------------------------------------------------------------
1 |
4 |
5 |
14 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/class.svg:
--------------------------------------------------------------------------------
1 |
4 |
10 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/cross.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/enum-kotlin.svg:
--------------------------------------------------------------------------------
1 |
4 |
5 |
14 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/enum.svg:
--------------------------------------------------------------------------------
1 |
4 |
10 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/exception-class.svg:
--------------------------------------------------------------------------------
1 |
4 |
10 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/field-value.svg:
--------------------------------------------------------------------------------
1 |
4 |
5 |
11 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/field-variable.svg:
--------------------------------------------------------------------------------
1 |
4 |
5 |
11 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/filter.svg:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/function.svg:
--------------------------------------------------------------------------------
1 |
4 |
10 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/homepage.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/interface-kotlin.svg:
--------------------------------------------------------------------------------
1 |
4 |
5 |
14 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/interface.svg:
--------------------------------------------------------------------------------
1 |
4 |
10 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/object.svg:
--------------------------------------------------------------------------------
1 |
4 |
5 |
14 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/placeholder.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/theme-toggle.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/docs/html/ui-kit/assets/typealias-kotlin.svg:
--------------------------------------------------------------------------------
1 |
4 |
5 |
14 |
--------------------------------------------------------------------------------
/fastlane/Appfile:
--------------------------------------------------------------------------------
1 | json_key_file("") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
2 | package_name("no.nordicsemi.android.kotlin.ble") # e.g. com.krausefx.app
3 |
--------------------------------------------------------------------------------
/fastlane/Fastfile:
--------------------------------------------------------------------------------
1 | # This file contains the fastlane.tools configuration
2 | # You can find the documentation at https://docs.fastlane.tools
3 | #
4 | # For a list of all available actions, check out
5 | #
6 | # https://docs.fastlane.tools/actions
7 | #
8 | # For a list of all available plugins, check out
9 | #
10 | # https://docs.fastlane.tools/plugins/available-plugins
11 | #
12 |
13 | # Uncomment the line if you want fastlane to automatically update itself
14 | # update_fastlane
15 |
16 | default_platform(:android)
17 |
18 | platform :android do
19 |
20 | desc "Deploy libraries to Nexus."
21 | lane :deployNexus do
22 | gradle(task: "publish")
23 | gradle(task: "releaseStagingRepositories")
24 | end
25 |
26 | desc "Generate docs."
27 | lane :generateDocs do
28 | gradle(task: "dokkaHtmlMultiModule")
29 | end
30 | end
31 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NordicSemiconductor/Kotlin-BLE-Library/94fac6172abb28aaa4c5bde4e2bfe63c70b3cb1e/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Oct 15 09:51:16 CEST 2024
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
5 | networkTimeout=10000
6 | validateDistributionUrl=true
7 | zipStoreBase=GRADLE_USER_HOME
8 | zipStorePath=wrapper/dists
9 |
--------------------------------------------------------------------------------
/profile/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/battery/BatteryLevelParser.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.battery
33 |
34 | import no.nordicsemi.kotlin.data.IntFormat
35 | import no.nordicsemi.kotlin.data.getInt
36 |
37 | object BatteryLevelParser {
38 |
39 | fun parse(bytes: ByteArray): Int? {
40 | if (bytes.size == 1) {
41 | return bytes.getInt(0, IntFormat.UINT8)
42 | }
43 | return null
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/bps/data/BloodPressureMeasurementData.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.bps.data
33 |
34 | import java.util.Calendar
35 |
36 | data class BloodPressureMeasurementData(
37 | val systolic: Float,
38 | val diastolic: Float,
39 | val meanArterialPressure: Float,
40 | val unit: BloodPressureType,
41 | val pulseRate: Float?,
42 | val userID: Int?,
43 | val status: BPMStatus?,
44 | val calendar: Calendar?
45 | )
46 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/bps/data/BloodPressureType.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.bps.data
33 |
34 | enum class BloodPressureType(internal val value: Int) {
35 | UNIT_MMHG(0),
36 | UNIT_KPA(1)
37 | }
38 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/bps/data/IntermediateCuffPressureData.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.bps.data
33 |
34 | import androidx.annotation.FloatRange
35 | import androidx.annotation.IntRange
36 | import java.util.Calendar
37 |
38 | data class IntermediateCuffPressureData(
39 | @FloatRange(from = 0.0) val cuffPressure: Float,
40 | val unit: BloodPressureType,
41 | @FloatRange(from = 0.0) val pulseRate: Float? = null,
42 | @IntRange(from = 0, to = 255) val userID: Int? = null,
43 | val status: BPMStatus? = null,
44 | val calendar: Calendar? = null
45 | )
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/cgm/data/CGMCalibrationStatus.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.cgm.data
33 |
34 | class CGMCalibrationStatus(val value: Int) {
35 | val rejected: Boolean
36 | val dataOutOfRange: Boolean
37 | val processPending: Boolean
38 |
39 | init {
40 | rejected = value and 0x01 != 0
41 | dataOutOfRange = value and 0x02 != 0
42 | processPending = value and 0x04 != 0
43 | }
44 | }
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/cgm/data/CGMErrorCode.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.cgm.data
33 |
34 | enum class CGMErrorCode(val value: Int) {
35 | CGM_ERROR_OP_CODE_NOT_SUPPORTED(2),
36 | CGM_ERROR_INVALID_OPERAND(3),
37 | CGM_ERROR_PROCEDURE_NOT_COMPLETED(4),
38 | CGM_ERROR_PARAMETER_OUT_OF_RANGE(5);
39 |
40 | companion object {
41 | fun create(value: Int): CGMErrorCode {
42 | return values().firstOrNull { it.value == value }
43 | ?: throw IllegalArgumentException("Cannot create error code for value: $value")
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/cgm/data/CGMRecord.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.cgm.data
33 |
34 | import android.os.Parcelable
35 | import kotlinx.parcelize.Parcelize
36 |
37 | @Parcelize
38 | data class CGMRecord(
39 | val glucoseConcentration: Float,
40 | val trend: Float?,
41 | val quality: Float?,
42 | val status: CGMStatus?,
43 | val timeOffset: Int,
44 | val crcPresent: Boolean
45 | ) : Parcelable
46 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/csc/data/CSCData.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.csc.data
33 |
34 | data class CSCData(
35 | val scanDevices: Boolean = false,
36 | val speed: Float = 0f,
37 | val cadence: Float = 0f,
38 | val distance: Float = 0f,
39 | val totalDistance: Float = 0f,
40 | val gearRatio: Float = 0f,
41 | val wheelSize: WheelSize = WheelSizes.default
42 | )
43 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/csc/data/CSCDataSnapshot.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.csc.data
33 |
34 | internal data class CSCDataSnapshot(
35 | var wheelRevolutions: Long = -1,
36 | var wheelEventTime: Int = -1,
37 | var crankRevolutions: Long = -1,
38 | var crankEventTime: Int = -1
39 | )
40 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/gls/data/Carbohydrate.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.gls.data
33 |
34 | enum class Carbohydrate(internal val value: Int) {
35 | RESERVED(0),
36 | BREAKFAST(1),
37 | LUNCH(2),
38 | DINNER(3),
39 | SNACK(4),
40 | DRINK(5),
41 | SUPPER(6),
42 | BRUNCH(7);
43 |
44 | companion object {
45 | fun create(value: Int): Carbohydrate {
46 | return values().firstOrNull { it.value == value }
47 | ?: throw IllegalArgumentException("Cannot create Carbohydrate for value $value")
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/gls/data/GLSData.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.gls.data
33 |
34 | internal data class GLSData(
35 | val records: List = emptyList(),
36 | val batteryLevel: Int? = null,
37 | val requestStatus: RequestStatus = RequestStatus.IDLE
38 | )
39 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/gls/data/GlucoseMeasurementUnit.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.gls.data
33 |
34 | enum class GlucoseMeasurementUnit {
35 | UNIT_mol_L,
36 | UNIT_kg_L
37 | }
38 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/gls/data/Health.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.gls.data
33 |
34 | enum class Health(internal val value: Int) {
35 | RESERVED(0),
36 | MINOR_HEALTH_ISSUES(1),
37 | MAJOR_HEALTH_ISSUES(2),
38 | DURING_MENSES(3),
39 | UNDER_STRESS(4),
40 | NO_HEALTH_ISSUES(5),
41 | NOT_AVAILABLE(15);
42 |
43 | companion object {
44 | fun create(value: Int): Health {
45 | return values().firstOrNull { it.value == value }
46 | ?: throw IllegalArgumentException("Cannot create Health for value $value")
47 | }
48 | }
49 | }
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/gls/data/Meal.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.gls.data
33 |
34 | enum class Meal(internal val value: Int) {
35 | RESERVED(0),
36 | PREPRANDIAL(1),
37 | POSTPRANDIAL(2),
38 | FASTING(3),
39 | CASUAL(4),
40 | BEDTIME(5);
41 |
42 | companion object {
43 | fun create(value: Int): Meal {
44 | return values().firstOrNull { it.value == value }
45 | ?: throw IllegalArgumentException("Cannot create Meal for value $value")
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/gls/data/Medication.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.gls.data
33 |
34 | enum class Medication(internal val value: Int) {
35 | RESERVED(0),
36 | RAPID_ACTING_INSULIN(1),
37 | SHORT_ACTING_INSULIN(2),
38 | INTERMEDIATE_ACTING_INSULIN(3),
39 | LONG_ACTING_INSULIN(4),
40 | PRE_MIXED_INSULIN(5);
41 |
42 | companion object {
43 | fun create(value: Int): Medication {
44 | return values().firstOrNull { it.value == value }
45 | ?: throw IllegalArgumentException("Cannot create Medication for value $value")
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/gls/data/RequestStatus.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.gls.data
33 |
34 | enum class RequestStatus {
35 | IDLE, PENDING, SUCCESS, ABORTED, FAILED, NOT_SUPPORTED
36 | }
37 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/gls/data/Tester.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.gls.data
33 |
34 | enum class Tester(internal val value: Int) {
35 | RESERVED(0),
36 | SELF(1),
37 | HEALTH_CARE_PROFESSIONAL(2),
38 | LAB_TEST(3),
39 | NOT_AVAILABLE(15);
40 |
41 | companion object {
42 | fun create(value: Int): Tester {
43 | return values().firstOrNull { it.value == value }
44 | ?: throw IllegalArgumentException("Cannot create Tester for value $value")
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/hrs/BodySensorLocationParser.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.hrs
33 |
34 | import no.nordicsemi.android.common.core.DataByteArray
35 | import no.nordicsemi.android.common.core.IntFormat
36 |
37 | object BodySensorLocationParser {
38 |
39 | fun parse(data: DataByteArray): Int? {
40 |
41 | if (data.size < 1) {
42 | return null
43 | }
44 |
45 | return data.getIntValue(IntFormat.FORMAT_UINT8, 0)
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/hrs/data/HRSData.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.hrs.data
33 |
34 | data class HRSData(
35 | val heartRate: Int,
36 | val sensorContact: Boolean,
37 | val energyExpanded: Int?,
38 | val rrIntervals: List
39 | )
40 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/hts/data/HTSData.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.hts.data
33 |
34 | import java.util.Calendar
35 |
36 | data class HTSData(
37 | val temperature: Float = 0f,
38 | val unit: TemperatureUnit = TemperatureUnit.CELSIUS,
39 | val timestamp: Calendar? = null,
40 | val type: Int? = null
41 | )
42 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/hts/data/TemperatureUnit.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.hts.data
33 |
34 | enum class TemperatureUnit(private val value: Int) {
35 | CELSIUS(0),
36 | FAHRENHEIT(1);
37 |
38 | companion object {
39 | fun create(value: Int): TemperatureUnit? {
40 | return values().firstOrNull { it.value == value }
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/prx/AlarmLevel.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.prx
33 |
34 | enum class AlarmLevel(internal val value: Byte) {
35 | NONE(0x00),
36 | MEDIUM(0x01),
37 | HIGH(0x02);
38 |
39 | companion object {
40 | internal fun create(value: Int): AlarmLevel {
41 | return AlarmLevel.values().firstOrNull { it.value.toInt() == value }
42 | ?: throw IllegalArgumentException("Cannot find AlarmLevel for provided value: $value")
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/prx/AlarmLevelParser.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.prx
33 |
34 | import no.nordicsemi.android.common.core.DataByteArray
35 | import no.nordicsemi.android.common.core.IntFormat
36 |
37 | object AlarmLevelParser {
38 |
39 | fun parse(bytes: DataByteArray): AlarmLevel? {
40 | if (bytes.size == 1) {
41 | val level: Int = bytes.getIntValue(IntFormat.FORMAT_UINT8, 0) ?: return null
42 | return AlarmLevel.create(level)
43 | }
44 | return null
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/prx/AlertLevelInputParser.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.prx
33 |
34 | import no.nordicsemi.android.common.core.DataByteArray
35 |
36 | object AlertLevelInputParser {
37 |
38 | fun parse(alarmLevel: AlarmLevel): DataByteArray {
39 | return DataByteArray.from(alarmLevel.value)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/prx/PRXData.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.prx
33 |
34 | data class PRXData(
35 | val localAlarmLevel: AlarmLevel = AlarmLevel.NONE,
36 | val isRemoteAlarm: Boolean = false,
37 | val linkLossAlarmLevel: AlarmLevel = AlarmLevel.HIGH
38 | )
39 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/racp/RACPOpCode.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.racp
33 |
34 | enum class RACPOpCode(internal val value: Int) {
35 | RACP_OP_CODE_REPORT_STORED_RECORDS(1),
36 | RACP_OP_CODE_DELETE_STORED_RECORDS(2),
37 | RACP_OP_CODE_ABORT_OPERATION(3),
38 | RACP_OP_CODE_REPORT_NUMBER_OF_RECORDS(4);
39 |
40 | companion object {
41 | fun create(value: Int): RACPOpCode {
42 | return values().firstOrNull { it.value == value }
43 | ?: throw IllegalArgumentException("Cannot create RACP op code for value: $value")
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/profile/src/main/java/no/nordicsemi/android/kotlin/ble/profile/rscs/data/RSCSData.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.profile.rscs.data
33 |
34 | data class RSCSData(
35 | val running: Boolean = false,
36 | val instantaneousSpeed: Float = 1.0f,
37 | val instantaneousCadence: Int = 0,
38 | val strideLength: Int? = null,
39 | val totalDistance: Long? = null
40 | )
41 |
--------------------------------------------------------------------------------
/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3 | "extends": [
4 | "config:base",
5 | "group:all",
6 | ":dependencyDashboard",
7 | "schedule:daily"
8 | ],
9 | "commitMessageExtra": "{{{currentValue}}} to {{#if isPinDigest}}{{{newDigestShort}}}{{else}}{{#if isMajor}}{{prettyNewMajor}}{{else}}{{#if isSingleVersion}}{{prettyNewVersion}}{{else}}{{#if newValue}}{{{newValue}}}{{else}}{{{newDigestShort}}}{{/if}}{{/if}}{{/if}}{{/if}}",
10 | "packageRules": [
11 | {
12 | "matchPackagePatterns": [
13 | "androidx.compose.compiler:compiler",
14 | "org.jetbrains.kotlin.*",
15 | "com.google.devtools.ksp",
16 | "androidx.compose.compiler"
17 | ],
18 | "groupName": "kotlin"
19 | },
20 | {
21 | "matchPackageNames": [
22 | "org.slf4j:slf4j-simple"
23 | ],
24 | "enabled": false
25 | }
26 | ]
27 | }
28 |
--------------------------------------------------------------------------------
/sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/sample/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | alias(libs.plugins.nordic.application.compose)
3 | alias(libs.plugins.nordic.hilt)
4 | }
5 |
6 | android {
7 | namespace = "no.nordicsemi.kotlin.ble.android.sample"
8 | defaultConfig {
9 | applicationId = "no.nordicsemi.kotlin.ble.android.sample"
10 | resourceConfigurations.add("en")
11 | }
12 | flavorDimensions += listOf("mode")
13 | productFlavors {
14 | create("native") {
15 | isDefault = true
16 | dimension = "mode"
17 | }
18 | create("mock") {
19 | dimension = "mode"
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | implementation(project(":advertiser-android"))
26 | implementation(project(":advertiser-android-mock"))
27 | implementation(project(":client-android"))
28 | implementation(project(":client-android-mock"))
29 |
30 | implementation(libs.nordic.ui)
31 | implementation(libs.nordic.theme)
32 | implementation(libs.nordic.permissions.ble)
33 |
34 | implementation(libs.androidx.activity.compose)
35 | implementation(libs.androidx.navigation.compose)
36 | implementation(libs.androidx.hilt.navigation.compose)
37 | implementation(libs.androidx.lifecycle.runtime.compose)
38 |
39 | // Binder SLF4J -> Timber
40 | implementation(libs.slf4j.timber)
41 | debugImplementation(libs.leakcanary)
42 | }
--------------------------------------------------------------------------------
/sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
16 |
17 |
27 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/sample/src/main/java/no/nordicsemi/kotlin/ble/android/sample/TestApplication.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.android.sample
33 |
34 | import android.app.Application
35 | import dagger.hilt.android.HiltAndroidApp
36 | import timber.log.Timber
37 |
38 | @HiltAndroidApp
39 | class TestApplication : Application() {
40 |
41 | override fun onCreate() {
42 | super.onCreate()
43 |
44 | Timber.plant(Timber.DebugTree())
45 | }
46 | }
--------------------------------------------------------------------------------
/sample/src/main/java/no/nordicsemi/kotlin/ble/android/sample/util/CloseableCoroutineScope.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.android.sample.util
33 |
34 | import dagger.hilt.android.lifecycle.RetainedLifecycle
35 | import kotlinx.coroutines.CoroutineScope
36 | import kotlinx.coroutines.cancel
37 | import kotlin.coroutines.CoroutineContext
38 |
39 | class CloseableCoroutineScope(context: CoroutineContext) : CoroutineScope, RetainedLifecycle.OnClearedListener {
40 | override val coroutineContext: CoroutineContext = context
41 |
42 | override fun onCleared() {
43 | coroutineContext.cancel()
44 | }
45 | }
--------------------------------------------------------------------------------
/sample/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NordicSemiconductor/Kotlin-BLE-Library/94fac6172abb28aaa4c5bde4e2bfe63c70b3cb1e/sample/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NordicSemiconductor/Kotlin-BLE-Library/94fac6172abb28aaa4c5bde4e2bfe63c70b3cb1e/sample/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NordicSemiconductor/Kotlin-BLE-Library/94fac6172abb28aaa4c5bde4e2bfe63c70b3cb1e/sample/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NordicSemiconductor/Kotlin-BLE-Library/94fac6172abb28aaa4c5bde4e2bfe63c70b3cb1e/sample/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NordicSemiconductor/Kotlin-BLE-Library/94fac6172abb28aaa4c5bde4e2bfe63c70b3cb1e/sample/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NordicSemiconductor/Kotlin-BLE-Library/94fac6172abb28aaa4c5bde4e2bfe63c70b3cb1e/sample/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NordicSemiconductor/Kotlin-BLE-Library/94fac6172abb28aaa4c5bde4e2bfe63c70b3cb1e/sample/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NordicSemiconductor/Kotlin-BLE-Library/94fac6172abb28aaa4c5bde4e2bfe63c70b3cb1e/sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NordicSemiconductor/Kotlin-BLE-Library/94fac6172abb28aaa4c5bde4e2bfe63c70b3cb1e/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NordicSemiconductor/Kotlin-BLE-Library/94fac6172abb28aaa4c5bde4e2bfe63c70b3cb1e/sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/sample/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Sample
3 |
--------------------------------------------------------------------------------
/sample/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/sample/src/native/java/no/nordicsemi/kotlin/ble/android/sample/di/SdkModule.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.kotlin.ble.android.sample.di
33 |
34 | import android.os.Build
35 | import dagger.Module
36 | import dagger.Provides
37 | import dagger.hilt.InstallIn
38 | import dagger.hilt.components.SingletonComponent
39 | import javax.inject.Named
40 |
41 | @Module
42 | @InstallIn(SingletonComponent::class)
43 | class SdkModule {
44 |
45 | @Provides
46 | @Named("sdkVersion")
47 | fun provideSdkVersion() = Build.VERSION.SDK_INT
48 |
49 | }
--------------------------------------------------------------------------------
/server-android-mock/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/server-android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/server-core-android/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | plugins {
33 | alias(libs.plugins.nordic.kotlin.jvm)
34 | alias(libs.plugins.nordic.nexus.jvm)
35 | }
36 |
37 | group = "no.nordicsemi.kotlin.ble"
38 |
39 | nordicNexusPublishing {
40 | POM_ARTIFACT_ID = "server-core-android"
41 | POM_NAME = "Nordic Kotlin BLE library"
42 | POM_DESCRIPTION = "Nordic Kotlin BLE library"
43 | POM_URL = "https://github.com/NordicSemiconductor/Kotlin-BLE-Library"
44 | POM_SCM_URL = "https://github.com/NordicSemiconductor/Kotlin-BLE-Library"
45 | POM_SCM_CONNECTION = "scm:git@github.com:NordicSemiconductor/Kotlin-BLE-Library.git"
46 | POM_SCM_DEV_CONNECTION = "scm:git@github.com:NordicSemiconductor/Kotlin-BLE-Library.git"
47 | }
48 |
49 | dependencies {
50 | api(project(":server-core"))
51 | }
52 |
--------------------------------------------------------------------------------
/server-core-android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/server-core-android/src/main/java/no/nordicsemi/kotlin/ble/server/android/PeripheralManager.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | @file:Suppress("MemberVisibilityCanBePrivate", "unused")
33 |
34 | package no.nordicsemi.kotlin.ble.server.android
35 |
36 | import kotlinx.coroutines.flow.Flow
37 | import no.nordicsemi.kotlin.ble.server.PeripheralManager
38 |
39 | /**
40 | * A Android Peripheral Manager extends the [PeripheralManager] interface with additional
41 | * Android-specific features.
42 | */
43 | interface PeripheralManager: PeripheralManager {
44 |
45 | /**
46 | * Returns a cold flow of connection events.
47 | *
48 | * Every time a device connects or disconnects, a new event will be emitted.
49 | */
50 | val connectionEvents: Flow
51 | }
52 |
--------------------------------------------------------------------------------
/server-core/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2024, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | plugins {
33 | alias(libs.plugins.nordic.kotlin.jvm)
34 | alias(libs.plugins.nordic.nexus.jvm)
35 | }
36 |
37 | group = "no.nordicsemi.kotlin.ble"
38 |
39 | nordicNexusPublishing {
40 | POM_ARTIFACT_ID = "server-core"
41 | POM_NAME = "Nordic Kotlin BLE library"
42 | POM_DESCRIPTION = "Nordic Kotlin BLE library"
43 | POM_URL = "https://github.com/NordicSemiconductor/Kotlin-BLE-Library"
44 | POM_SCM_URL = "https://github.com/NordicSemiconductor/Kotlin-BLE-Library"
45 | POM_SCM_CONNECTION = "scm:git@github.com:NordicSemiconductor/Kotlin-BLE-Library.git"
46 | POM_SCM_DEV_CONNECTION = "scm:git@github.com:NordicSemiconductor/Kotlin-BLE-Library.git"
47 | }
48 |
49 | dependencies {
50 | api(project(":core"))
51 | }
52 |
--------------------------------------------------------------------------------
/server-core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/test/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NordicSemiconductor/Kotlin-BLE-Library/94fac6172abb28aaa4c5bde4e2bfe63c70b3cb1e/test/consumer-rules.pro
--------------------------------------------------------------------------------
/test/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/test/src/androidTest/java/no/nordicsemi/android/kotlin/ble/test/BluetoothGattServiceFactoryTest.kt:
--------------------------------------------------------------------------------
1 | package no.nordicsemi.android.kotlin.ble.test
2 |
3 | import android.bluetooth.BluetoothGattCharacteristic
4 | import android.bluetooth.BluetoothGattDescriptor
5 | import androidx.test.ext.junit.runners.AndroidJUnit4
6 | import no.nordicsemi.android.kotlin.ble.core.data.BleGattPermission
7 | import no.nordicsemi.android.kotlin.ble.core.data.BleGattProperty
8 | import no.nordicsemi.android.kotlin.ble.server.main.service.BluetoothGattServiceFactory
9 | import no.nordicsemi.android.kotlin.ble.test.utils.BlinkySpecifications
10 | import org.junit.Test
11 | import org.junit.runner.RunWith
12 | import kotlin.test.assertEquals
13 |
14 | @RunWith(AndroidJUnit4::class)
15 | class BluetoothGattServiceFactoryTest {
16 |
17 | @Test
18 | fun whenCloneCharacteristicShouldAlsoCloneDescriptors() {
19 | val characteristic = BluetoothGattCharacteristic(
20 | BlinkySpecifications.UUID_BUTTON_CHAR,
21 | BleGattPermission.toInt(listOf(BleGattPermission.PERMISSION_READ)),
22 | BleGattProperty.toInt(listOf(BleGattProperty.PROPERTY_NOTIFY)),
23 | )
24 |
25 | val descriptor = BluetoothGattDescriptor(
26 | BlinkySpecifications.UUID_LED_CHAR,
27 | BleGattPermission.toInt(listOf(BleGattPermission.PERMISSION_READ)),
28 | )
29 |
30 | characteristic.addDescriptor(descriptor)
31 |
32 | val clone = BluetoothGattServiceFactory.cloneCharacteristic(characteristic)
33 |
34 | assertEquals(1, clone.descriptors.size)
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/test/src/androidTest/java/no/nordicsemi/android/kotlin/ble/test/DeadlockTwoDevices.kt:
--------------------------------------------------------------------------------
1 | package no.nordicsemi.android.kotlin.ble.test
2 |
3 | import androidx.test.ext.junit.runners.AndroidJUnit4
4 | import androidx.test.platform.app.InstrumentationRegistry
5 | import kotlinx.coroutines.CoroutineScope
6 | import kotlinx.coroutines.launch
7 | import kotlinx.coroutines.runBlocking
8 | import kotlinx.coroutines.test.UnconfinedTestDispatcher
9 | import no.nordicsemi.android.kotlin.ble.client.main.callback.ClientBleGatt
10 | import no.nordicsemi.android.kotlin.ble.core.data.BleGattConnectOptions
11 | import no.nordicsemi.android.kotlin.ble.core.data.BleGattConnectionPriority
12 | import no.nordicsemi.android.kotlin.ble.test.utils.BlinkySpecifications
13 | import no.nordicsemi.android.kotlin.ble.test.utils.TestAddressProvider
14 | import org.junit.Test
15 | import org.junit.runner.RunWith
16 |
17 | @RunWith(AndroidJUnit4::class)
18 | class DeadlockTwoDevices {
19 |
20 | private val address = TestAddressProvider.address
21 | private val address2 = TestAddressProvider.auxiliaryAddress
22 |
23 | private val scope = CoroutineScope(UnconfinedTestDispatcher())
24 |
25 | private val testCount = 10
26 |
27 | @Test
28 | fun deadLockTwoDevices() = runBlocking {
29 | val j1 = scope.launch {
30 | repeat(testCount) {
31 | val c1 = ClientBleGatt.connect(InstrumentationRegistry.getInstrumentation().targetContext, address, scope)
32 | if (!c1.isConnected) {
33 | return@launch
34 | }
35 | // c1.requestMtu(23)
36 | c1.requestConnectionPriority(BleGattConnectionPriority.LOW_POWER)
37 | c1.disconnect()
38 | }
39 | }
40 |
41 | val j2 = scope.launch {
42 | repeat(testCount) {
43 | val c2 = ClientBleGatt.connect(InstrumentationRegistry.getInstrumentation().targetContext, address2, scope)
44 | if (!c2.isConnected) {
45 | return@launch
46 | }
47 | // c2.requestMtu(23)
48 | c2.requestConnectionPriority(BleGattConnectionPriority.LOW_POWER)
49 | c2.disconnect()
50 | }
51 | }
52 |
53 | j1.join()
54 | j2.join()
55 | }
56 | }
--------------------------------------------------------------------------------
/test/src/androidTest/java/no/nordicsemi/android/kotlin/ble/test/GetNotificationsStuckTest.kt:
--------------------------------------------------------------------------------
1 | package no.nordicsemi.android.kotlin.ble.test
2 |
3 | import androidx.test.ext.junit.runners.AndroidJUnit4
4 | import androidx.test.platform.app.InstrumentationRegistry
5 | import kotlinx.coroutines.CoroutineScope
6 | import kotlinx.coroutines.flow.catch
7 | import kotlinx.coroutines.flow.first
8 | import kotlinx.coroutines.runBlocking
9 | import kotlinx.coroutines.test.UnconfinedTestDispatcher
10 | import kotlinx.coroutines.test.runTest
11 | import no.nordicsemi.android.kotlin.ble.client.main.callback.ClientBleGatt
12 | import no.nordicsemi.android.kotlin.ble.core.errors.DeviceDisconnectedException
13 | import no.nordicsemi.android.kotlin.ble.test.utils.BlinkySpecifications
14 | import no.nordicsemi.android.kotlin.ble.test.utils.TestAddressProvider
15 | import org.junit.Test
16 | import org.junit.Assert
17 | import org.junit.runner.RunWith
18 |
19 | @RunWith(AndroidJUnit4::class)
20 | class GetNotificationsStuckTest {
21 |
22 | private val service = BlinkySpecifications.UUID_SERVICE_DEVICE
23 | private val char = BlinkySpecifications.UUID_BUTTON_CHAR
24 |
25 | private val address = TestAddressProvider.address
26 |
27 | private val scope = CoroutineScope(UnconfinedTestDispatcher())
28 |
29 | @Test
30 | fun whenGetNotificationsAfterDisconnectShouldThrow() = runTest {
31 | val context = InstrumentationRegistry.getInstrumentation().targetContext
32 | val gatt = ClientBleGatt.connect(context, address, scope)
33 | val services = gatt.discoverServices()
34 | val not = services.findService(service)?.findCharacteristic(char)!!
35 | gatt.disconnect() // Simulate a device disconnection
36 | Assert.assertThrows(DeviceDisconnectedException::class.java) {
37 | runBlocking {
38 | not.getNotifications().first() //Issue: stuck here forever
39 | }
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/test/src/androidTest/java/no/nordicsemi/android/kotlin/ble/test/ReadFromDisconnectedDeviceTest.kt:
--------------------------------------------------------------------------------
1 | package no.nordicsemi.android.kotlin.ble.test
2 |
3 | import androidx.test.ext.junit.runners.AndroidJUnit4
4 | import androidx.test.platform.app.InstrumentationRegistry
5 | import kotlinx.coroutines.CoroutineScope
6 | import kotlinx.coroutines.runBlocking
7 | import kotlinx.coroutines.test.UnconfinedTestDispatcher
8 | import kotlinx.coroutines.test.runTest
9 | import no.nordicsemi.android.kotlin.ble.client.main.callback.ClientBleGatt
10 | import no.nordicsemi.android.kotlin.ble.core.errors.DeviceDisconnectedException
11 | import no.nordicsemi.android.kotlin.ble.test.utils.BlinkySpecifications
12 | import no.nordicsemi.android.kotlin.ble.test.utils.TestAddressProvider
13 | import org.junit.Assert
14 | import org.junit.Test
15 | import org.junit.runner.RunWith
16 |
17 | @RunWith(AndroidJUnit4::class)
18 | class ReadFromDisconnectedDeviceTest {
19 |
20 | private val service = BlinkySpecifications.UUID_SERVICE_DEVICE
21 | private val char = BlinkySpecifications.UUID_LED_CHAR
22 |
23 | private val address = TestAddressProvider.address
24 |
25 | private val scope = CoroutineScope(UnconfinedTestDispatcher())
26 |
27 | @Test
28 | fun whenReadAfterDisconnectShouldThrow() = runTest {
29 | val context = InstrumentationRegistry.getInstrumentation().targetContext
30 | val gatt = ClientBleGatt.connect(context, address, scope)
31 | val services = gatt.discoverServices()
32 | val char = services.findService(service)?.findCharacteristic(char)
33 | gatt.disconnect() // Simulate a device disconnection
34 | Assert.assertThrows(DeviceDisconnectedException::class.java) {
35 | runBlocking {
36 | char?.read()!! //Issue: stuck here forever
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/test/src/androidTest/java/no/nordicsemi/android/kotlin/ble/test/SimultaneousRssiStuckTest.kt:
--------------------------------------------------------------------------------
1 | package no.nordicsemi.android.kotlin.ble.test
2 |
3 | import androidx.test.ext.junit.runners.AndroidJUnit4
4 | import androidx.test.platform.app.InstrumentationRegistry
5 | import kotlinx.coroutines.CoroutineScope
6 | import kotlinx.coroutines.launch
7 | import kotlinx.coroutines.sync.Mutex
8 | import kotlinx.coroutines.sync.withLock
9 | import kotlinx.coroutines.test.UnconfinedTestDispatcher
10 | import kotlinx.coroutines.test.runTest
11 | import no.nordicsemi.android.kotlin.ble.client.main.callback.ClientBleGatt
12 | import no.nordicsemi.android.kotlin.ble.test.utils.TestAddressProvider
13 | import org.junit.Test
14 | import org.junit.runner.RunWith
15 |
16 | @RunWith(AndroidJUnit4::class)
17 | class SimultaneousRssiStuckTest {
18 |
19 | private val address = TestAddressProvider.address
20 | private val address2 = TestAddressProvider.auxiliaryAddress
21 |
22 | private val scope = CoroutineScope(UnconfinedTestDispatcher())
23 |
24 | private val repeat = 5
25 |
26 | @Test
27 | fun whenReadRssiWithoutMutexShouldWork() = runTest {
28 | val context = InstrumentationRegistry.getInstrumentation().targetContext
29 | val gatt = ClientBleGatt.connect(context, address, scope)
30 | val gatt2 = ClientBleGatt.connect(context, address2, scope)
31 | val mutex = Mutex()
32 |
33 | // This one passes when using a mutex
34 | repeat(repeat) {
35 | val jobs = listOf(
36 | launch { mutex.withLock { gatt.readRssi() } },
37 | launch { mutex.withLock { gatt2.readRssi() } }
38 | )
39 | jobs.forEach { it.join() }
40 | }
41 |
42 | //Issue: This one gets stuck when no mutex is used
43 | repeat(repeat) {
44 | val jobs = listOf(
45 | launch { gatt.readRssi() },
46 | launch { gatt2.readRssi() }
47 | )
48 | jobs.forEach { it.join() }
49 | }
50 | }
51 | }
--------------------------------------------------------------------------------
/test/src/androidTest/java/no/nordicsemi/android/kotlin/ble/test/utils/BlinkySpecifications.kt:
--------------------------------------------------------------------------------
1 | package no.nordicsemi.android.kotlin.ble.test.utils
2 |
3 | import java.util.UUID
4 |
5 | object BlinkySpecifications {
6 | /** Nordic Blinky Service UUID. */
7 | val UUID_SERVICE_DEVICE: UUID = UUID.fromString("00001523-1212-efde-1523-785feabcd123")
8 |
9 | /** LED characteristic UUID. */
10 | val UUID_LED_CHAR: UUID = UUID.fromString("00001525-1212-efde-1523-785feabcd123")
11 |
12 | /** BUTTON characteristic UUID. */
13 | val UUID_BUTTON_CHAR: UUID = UUID.fromString("00001524-1212-efde-1523-785feabcd123")
14 |
15 | /** Notification descriptor UUID. */
16 | val NOTIFICATION_DESCRIPTOR = UUID.fromString("00002902-0000-1000-8000-00805f9b34fb")
17 | }
18 |
--------------------------------------------------------------------------------
/test/src/androidTest/java/no/nordicsemi/android/kotlin/ble/test/utils/TestAddressProvider.kt:
--------------------------------------------------------------------------------
1 | package no.nordicsemi.android.kotlin.ble.test.utils
2 |
3 | object TestAddressProvider {
4 |
5 | val address = "F6:1B:1A:66:27:57"
6 | val auxiliaryAddress = "CA:CC:95:E9:72:2B"
7 | }
8 |
--------------------------------------------------------------------------------
/test/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/test/src/test/java/no/nordicsemi/android/kotlin/ble/test/ApplicationScopeModule.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2023, Nordic Semiconductor
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without modification, are
6 | * permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this list of
9 | * conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 | * of conditions and the following disclaimer in the documentation and/or other materials
13 | * provided with the distribution.
14 | *
15 | * 3. Neither the name of the copyright holder nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific prior
17 | * written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package no.nordicsemi.android.kotlin.ble.test
33 |
34 | import dagger.Module
35 | import dagger.Provides
36 | import dagger.hilt.InstallIn
37 | import dagger.hilt.components.SingletonComponent
38 | import kotlinx.coroutines.CoroutineScope
39 | import kotlinx.coroutines.SupervisorJob
40 | import kotlinx.coroutines.test.UnconfinedTestDispatcher
41 |
42 | @Module
43 | @InstallIn(SingletonComponent::class)
44 | class ApplicationScopeModule {
45 |
46 | @Provides
47 | internal fun provideServerDevice(): CoroutineScope {
48 | return CoroutineScope(SupervisorJob() + UnconfinedTestDispatcher())
49 | }
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/test/src/test/java/no/nordicsemi/android/kotlin/ble/test/BlinkySpecifications.kt:
--------------------------------------------------------------------------------
1 | package no.nordicsemi.android.kotlin.ble.test
2 |
3 | import java.util.UUID
4 |
5 | object BlinkySpecifications {
6 | /** Nordic Blinky Service UUID. */
7 | val UUID_SERVICE_DEVICE: UUID = UUID.fromString("00001523-1212-efde-1523-785feabcd123")
8 |
9 | /** LED characteristic UUID. */
10 | val UUID_LED_CHAR: UUID = UUID.fromString("00001525-1212-efde-1523-785feabcd123")
11 |
12 | /** BUTTON characteristic UUID. */
13 | val UUID_BUTTON_CHAR: UUID = UUID.fromString("00001524-1212-efde-1523-785feabcd123")
14 |
15 | /** Notification descriptor UUID. */
16 | val NOTIFICATION_DESCRIPTOR = UUID.fromString("00002902-0000-1000-8000-00805f9b34fb")
17 | }
18 |
--------------------------------------------------------------------------------