RF24Network Send example program.

Dependencies:   xtoff RF24Network mbed

Fork of RF24Network_Send by Akash Vibhute

Revision:
11:2aa84e063c49
Parent:
10:875812a04307
Child:
12:38c5efed7950
--- a/Verzender.cpp	Mon Mar 12 11:02:12 2018 +0000
+++ b/Verzender.cpp	Wed Mar 21 16:22:34 2018 +0000
@@ -25,26 +25,37 @@
     network.update();
 }
 
-
-bool Verzender::write(payload_t message)
+bool Verzender::write(payload_t packet)
 {
     RF24NetworkHeader header_tx(other_node);
     payload_t payload_tx;
-    payload_tx = message;
+    payload_tx = packet;
+    
+    payload_tx.messageIndex = 0;
+    payload_tx.messageAvailable = false;
+    
     return network.write(header_tx,&payload_tx,sizeof(payload_tx));
 }
 
-
+void Verzender::sendMessage(char index){
+         
+        pc2.printf("Sendmessage: %c\n\r", index);
+        RF24NetworkHeader header_tx(other_node);
+        payload_t payload_message;
+        payload_message.messageIndex = index;
+        payload_message.messageAvailable = true;
+        bool test = network.write(header_tx,&payload_message,sizeof(payload_message));
+    }
 
 state_Packet Verzender::read()
 {
     state_Packet packet;
     network.read(header_rx,&packet,sizeof(packet));
-
+    
     return packet;
 }
 
 bool Verzender::available()
 {
     return network.available();
-}
\ No newline at end of file
+}