 			if (len == sizeof(pong)) {
 				memcpy(&pong, buf, sizeof(pong));
 
-				if (strcmp(pong.msg, "ping") == 0) {
+				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
-					strcpy(pong.msg, "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);

					rf95.send((uint8_t *)&pong, sizeof(pong));
					rf95.waitPacketSent();
				}
				else if (strcmp(pong.msg, "pong") == 0) {
					// got pong, print stats
					sprintf(line, "Got PONG(%d,%d,%d)", pong.count, pong.rssi, pong.replier);
					Serial.println(line);
				}
				else {
					sprintf(line, "???(%d,%d,%d,%d,%s)", pong.count, pong.rssi, pong.initiator, pong.replier, pong.msg);
					Serial.println(line);
				}
			} else {

#include <RH_RF95.h>

typedef struct {
	uint8_t type;
	uint8_t count;  // counter
	uint8_t initiator, replier;
	int rssi;       // signal strength
} 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);
