diff --git a/core/api/README.md b/core/api/README.md index 58d9f3ed4..121b10e46 100644 --- a/core/api/README.md +++ b/core/api/README.md @@ -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). diff --git a/core/model/README.md b/core/model/README.md index b917b32b7..8ca5c198b 100644 --- a/core/model/README.md +++ b/core/model/README.md @@ -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") -``` \ No newline at end of file +implementation("com.github.meshtastic.Meshtastic-Android:meshtastic-android-model:v2.7.13") +``` diff --git a/core/proto/README.md b/core/proto/README.md index cc3afeda8..85c20c62e 100644 --- a/core/proto/README.md +++ b/core/proto/README.md @@ -19,3 +19,21 @@ classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000; ``` + +## 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") +```