@@ -23,7 +23,7 @@ uint32_t want_config_id = 0;
2323uint32_t my_node_num = 0 ;
2424
2525bool 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 ;
2727void (*node_report_callback)(mt_node_t *, mt_nr_progress_t ) = NULL ;
2828mt_node_t node;
2929
@@ -116,7 +116,7 @@ bool mt_send_text(const char * text, uint32_t dest, uint8_t channel_index) {
116116 return _mt_send_toRadio (toRadio);
117117}
118118
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)) {
120120 text_message_callback = callback;
121121}
122122
@@ -190,7 +190,7 @@ bool handle_mesh_packet(meshtastic_MeshPacket *meshPacket) {
190190 if (meshPacket->which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
191191 if (meshPacket->decoded .portnum == meshtastic_PortNum_TEXT_MESSAGE_APP) {
192192 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 );
194194 } else {
195195 // TODO handle other portnums
196196 return false ;
0 commit comments