@@ -23,7 +23,7 @@ uint32_t want_config_id = 0;
23
23
uint32_t my_node_num = 0 ;
24
24
25
25
bool mt_debugging = false ;
26
- void (*text_message_callback)(uint32_t from, uint32_t to, const char * text) = NULL ;
26
+ void (*text_message_callback)(uint32_t from, uint32_t to, uint8_t channel, const char * text) = NULL ;
27
27
void (*node_report_callback)(mt_node_t *, mt_nr_progress_t ) = NULL ;
28
28
mt_node_t node;
29
29
@@ -116,7 +116,7 @@ bool mt_send_text(const char * text, uint32_t dest, uint8_t channel_index) {
116
116
return _mt_send_toRadio (toRadio);
117
117
}
118
118
119
- void set_text_message_callback (void (*callback)(uint32_t from, uint32_t to, const char * text)) {
119
+ void set_text_message_callback (void (*callback)(uint32_t from, uint32_t to, uint8_t channel, const char * text)) {
120
120
text_message_callback = callback;
121
121
}
122
122
@@ -190,7 +190,7 @@ bool handle_mesh_packet(meshtastic_MeshPacket *meshPacket) {
190
190
if (meshPacket->which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
191
191
if (meshPacket->decoded .portnum == meshtastic_PortNum_TEXT_MESSAGE_APP) {
192
192
if (text_message_callback != NULL )
193
- text_message_callback (meshPacket->from , meshPacket->to , (const char *)meshPacket->decoded .payload .bytes );
193
+ text_message_callback (meshPacket->from , meshPacket->to , meshPacket-> channel , (const char *)meshPacket->decoded .payload .bytes );
194
194
} else {
195
195
// TODO handle other portnums
196
196
return false ;
0 commit comments