 #include <RH_RF95.h>
 
 typedef struct {
-	char msg[5];    // ping or pong
-	int count;      // counter
+	uint8_t type;
+	uint8_t count;  // counter
+	uint8_t initiator, replier;
 	int rssi;       // signal strength
-	int initiator, replier;
 } pingpong_t;
 
 // Singleton instance of the radio driver
 static RH_RF95 rf95;
 static pingpong_t ping;
 static pingpong_t pong;
+
+#define T_PING 1
+#define T_PONG 2
 
 void setup() {
 	Serial.begin(115200);

	rf95.setFrequency(869.525);
	rf95.setModemConfig(RH_RF95::Bw125Cr48Sf4096);

	//    rf95.setTxPower(20);

	// init ping
	strcpy(ping.msg, "ping");
	ping.count = 0;
	ping.rssi = 0;
	ping.initiator = 216; // FIXME CHANGE THIS TO SOMETHING UNIQUE
	pong.replier = -1;

	pong.initiator = -1;

			if (len == sizeof(pong)) {
				memcpy(&pong, buf, sizeof(pong));

				if (pong.type == T_PING) {
					// got ping
					sprintf(line, "Recv PING(%d,%d,%d)", pong.count, pong.rssi, pong.initiator);
					Serial.println(line);
					// send pong
					pong.type = T_PONG;
					pong.rssi = rf95.lastRssi();
					pong.replier = ping.initiator;
					sprintf(line, "Send PONG(%d,%d,%d)", pong.count, pong.rssi, pong.replier);
