mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-27 02:01:35 -04:00
docs: Update READMEs and library versions
This commit updates the README files for the `core:api`, `core:model`, and `core:proto` modules to improve documentation and reflect current usage. Key changes include: - Bumping the library version to `v2.7.13` in usage examples. - Adding a detailed README for the `core:proto` module. - Updating the `core:api` README to use `MeshtasticIntent` constants instead of hardcoded strings. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
@@ -27,7 +27,7 @@ dependencies {
|
||||
// Replace 'v2.7.13' with the specific version you need
|
||||
val meshtasticVersion = "v2.7.13"
|
||||
|
||||
// The core AIDL interface
|
||||
// The core AIDL interface and Intent constants
|
||||
implementation("com.github.meshtastic.Meshtastic-Android:meshtastic-android-api:$meshtasticVersion")
|
||||
|
||||
// Data models (DataPacket, MeshUser, NodeInfo, etc.)
|
||||
@@ -77,15 +77,17 @@ override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
|
||||
|
||||
### 3. Register a BroadcastReceiver
|
||||
|
||||
To receive packets and status updates, register a `BroadcastReceiver`.
|
||||
To receive packets and status updates, register a `BroadcastReceiver`. Use `MeshtasticIntent` constants for the actions.
|
||||
|
||||
**Important:** On Android 13+ (API 33), you **must** use `RECEIVER_EXPORTED` since you are receiving broadcasts from a different application.
|
||||
|
||||
```kotlin
|
||||
// Using constants from org.meshtastic.core.api.MeshtasticIntent
|
||||
val intentFilter = IntentFilter().apply {
|
||||
addAction("com.geeksville.mesh.RECEIVED.TEXT_MESSAGE_APP")
|
||||
addAction("com.geeksville.mesh.NODE_CHANGE")
|
||||
addAction("com.geeksville.mesh.CONNECTION_CHANGED")
|
||||
addAction(MeshtasticIntent.ACTION_RECEIVED_TEXT_MESSAGE_APP)
|
||||
addAction(MeshtasticIntent.ACTION_NODE_CHANGE)
|
||||
addAction(MeshtasticIntent.ACTION_CONNECTION_CHANGED)
|
||||
addAction(MeshtasticIntent.ACTION_MESH_DISCONNECTED)
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
@@ -97,6 +99,6 @@ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
|
||||
## Modules
|
||||
|
||||
* **`core:api`**: Contains `IMeshService.aidl`.
|
||||
* **`core:api`**: Contains `IMeshService.aidl` and `MeshtasticIntent`.
|
||||
* **`core:model`**: Contains Parcelable data classes like `DataPacket`, `MeshUser`, `NodeInfo`.
|
||||
* **`core:proto`**: Contains the generated Protobuf code (Wire).
|
||||
|
||||
@@ -36,5 +36,5 @@ This module contains the Parcelable data classes used by the Meshtastic Android
|
||||
This module is typically used as a dependency of `core:api` but can be used independently if you need to work with Meshtastic data structures.
|
||||
|
||||
```kotlin
|
||||
implementation("com.github.meshtastic.Meshtastic-Android:meshtastic-android-model:v2.7.12")
|
||||
```
|
||||
implementation("com.github.meshtastic.Meshtastic-Android:meshtastic-android-model:v2.7.13")
|
||||
```
|
||||
|
||||
@@ -19,3 +19,21 @@ classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
|
||||
|
||||
```
|
||||
<!--endregion-->
|
||||
|
||||
## Meshtastic Protobuf Definitions
|
||||
|
||||
This module contains the generated Kotlin and Java code from the Meshtastic Protobuf definitions. It uses the [Wire](https://github.com/square/wire) library for efficient and clean model generation.
|
||||
|
||||
### Key Components
|
||||
|
||||
* **Port Numbers**: Defines the `PortNum` enum for identifying different types of data payloads.
|
||||
* **Mesh Protocol**: Contains the core `MeshPacket` and protocol message definitions.
|
||||
* **Modules**: Includes definitions for telemetry, position, administration, and more.
|
||||
|
||||
### Usage
|
||||
|
||||
This module is typically used as a dependency of `core:api` and `core:model`.
|
||||
|
||||
```kotlin
|
||||
implementation("com.github.meshtastic.Meshtastic-Android:meshtastic-android-proto:v2.7.13")
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user