
Facilitates communication with a Raspberry Pi Pico daemon, enabling human-readable client commands and abstracting raw byte data manipulation for seamless integration.
PGNC (pico-gpio-net-client) is a Kotlin library for interacting with a pico-gpio-net (PGN) daemon running on a Raspberry Pi Pico.
It abstracts away the nitty-gritty of communicating with PGN, so you can utilize human-readable client commands instead of manipulating raw byte data.
PGNC supports all KMM platforms except for web.
| Platform | Supported |
|---|---|
| JVM | ✓ |
| Android | ✓ |
| Native | ✓ |
| iOS | ✓ |
| Web | ✗ |
| tvOS | ✓ |
| watchOS | ✓ |
val rpiPicoIpAddress = "192.168.1.150"
val client = PicoGpioNetClient(
ip = rpiPicoIpAddress,
port = 8080,
autoFlush = false
)
client.connect()
val deviceName = client.getName()
client.close()The above example connects to the PGN daemon running on a Raspberry Pi Pico device on IP address 192.168.1.150, port 8080.
It then asks the device to name itself, stores the value in the deviceName variable, then closes the socket connection.
Under-the-hood, the client library is doing the following:
The setup instructions below assume that you're building a gradle project, with a TOML file for dependency management and KTS files for gradle scripts.
The instructions should still work for other setups with minor changes.
# libs.versions.toml
[versions]
pgnc = "1.0.0"
[libraries]
pgnc-library-core = { module = "dev.mcarr.pgnc:library", version.ref = "pgnc" }// app (not root) build.gradle.kts
kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation(libs.pgnc.library.core)
}
}
}
}Javadoc can be found here.
PGNC (pico-gpio-net-client) is a Kotlin library for interacting with a pico-gpio-net (PGN) daemon running on a Raspberry Pi Pico.
It abstracts away the nitty-gritty of communicating with PGN, so you can utilize human-readable client commands instead of manipulating raw byte data.
PGNC supports all KMM platforms except for web.
| Platform | Supported |
|---|---|
| JVM | ✓ |
| Android | ✓ |
| Native | ✓ |
| iOS | ✓ |
| Web | ✗ |
| tvOS | ✓ |
| watchOS | ✓ |
val rpiPicoIpAddress = "192.168.1.150"
val client = PicoGpioNetClient(
ip = rpiPicoIpAddress,
port = 8080,
autoFlush = false
)
client.connect()
val deviceName = client.getName()
client.close()The above example connects to the PGN daemon running on a Raspberry Pi Pico device on IP address 192.168.1.150, port 8080.
It then asks the device to name itself, stores the value in the deviceName variable, then closes the socket connection.
Under-the-hood, the client library is doing the following:
The setup instructions below assume that you're building a gradle project, with a TOML file for dependency management and KTS files for gradle scripts.
The instructions should still work for other setups with minor changes.
# libs.versions.toml
[versions]
pgnc = "1.0.0"
[libraries]
pgnc-library-core = { module = "dev.mcarr.pgnc:library", version.ref = "pgnc" }// app (not root) build.gradle.kts
kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation(libs.pgnc.library.core)
}
}
}
}Javadoc can be found here.