A sample project demonstrating how to integrate and use the RSDK (Radio SDK) in a Linux environment using the JVM.
This project showcases the integration of RSDK in a Linux JVM environment. It demonstrates how to initialize the SDK, manage radio connection events, and use its functionalities in a desktop or server-side application.
- Java Development Kit (JDK 11 or later)
- Apache Maven or Gradle (depending on your project configuration)
- Git
Clone the repository to your local machine:
git clone https://github.com/yourrepo/rsdk-sample.gitThe Radio SDK is hosted on a private goTenna Artifactory. The repository is set up in settings.gradle.kts and uses the credentials provided in the local.properties file. Provide your credentials there.
# local.properties
artifactory.user=
artifactory.password=
# token
sdk.token=
sdk.app.id=The SDK is included in the app dependencies, it is recommended to add the kotlinx-serialization-protobuf-jvm library as well, as it is used for serialization in the SDK.
// spring-boot/build.gradle.kts
dependencies {
...
implementation(libs.radioSdk)
implementation(libs.kotlinx.serialization.protobuf.jvm)
}GotennaClient.initialize(
sdkToken = SDK_TOKEN,
appId = APP_ID,
)Will let you know if the connection status of any of the connected radios changes.
GotennaClient.observeRadios().collect { radios ->
}Will return a list of radios found nearby.
val radioList = GotennaClient.scan(ConnectionType.USB)Take the radio from the scan list and call .connect() on it.
val result = radio.connect()What we normally do is this:
- Node A sends everyone on the mesh network its LocationModel as a broadcast message every minute.
- Node B receives LocationModel from A and other nodes.
- Node B stores (app logic) the GID of each node in a contact list.
- Node B uses the contact list to get the GID of the node they want to contact.