you couldread the UDP packet into a byte array such as packetBuffer[] and then process it, e.g.
#include <SPI.h> // needed for Arduino versions later than 0018
#include <Ethernet.h>
#include <EthernetUdp.h> // UDP library from: bjoern@cs.stanford.edu 12/30/2008
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(192, 168, 1, 177);
unsigned int localPort = 999;//8888; // local port to listen on
EthernetUDP Udp;
void setup() {
Serial.begin(115200);
Serial.println("UDP program");
// start the Ethernet and UDP:
if(Ethernet.begin(mac))Serial.println("Configured Ethernet using DHCP OK");
else Serial.println("Failed to configure Ethernet using DHCP");
// print your local IP address:
Serial.print("My IP address: ");
for (byte thisByte = 0; thisByte < 4; thisByte++) {
// print the value of each byte of the IP address:
Serial.print(Ethernet.localIP()[thisByte], DEC);
Serial.print(".");
}
Serial.println();
if(Udp.begin(localPort))Serial.println("UDP begin() OK");
else Serial.println("UDP begin() failed!");
}
void loop() {
// if there's data available, read a packet
int packetSize = Udp.parsePacket();
if (packetSize) {
Serial.print("Received packet of size ");
Serial.println(packetSize);
Serial.print("From ");
IPAddress remote = Udp.remoteIP();
for (int i = 0; i < 4; i++) {
Serial.print(remote[i], DEC);
if (i < 3) {
Serial.print(".");
}
}
Serial.print(", port ");
Serial.println(Udp.remotePort());
// read the packet into packetBufffer
byte packetBuffer[packetSize]={0};
for(int i=0;i<packetSize;i++)
packetBuffer[i]=Udp.read(); // read the packet into array
Serial.print("Contents: ");
for(int i=0;i<packetSize;i++) // print contents
{Serial.print(packetBuffer[i]&0xff,HEX); Serial.print(" "); }
// search for STATUS
byte * ptr=(byte *)memmem(packetBuffer, sizeof(packetBuffer),"STATUS",6);
if(ptr==NULL)Serial.println("NULL");
else { // if STATUS found print data
Serial.println("found");
do { ptr++; } while(*ptr != '\"'); // search for starting "
while(*(++ptr) != '\"') // print until terminating " found
Serial.print((char)*ptr);
}
}
}
when the following byte array is transmitted
int port=999; // port to send/receive datagrams on
String remoteIPaddress= "192.168.1.177"; // IP to send datagrams
byte[] packetBuffer={(byte)0x02,(byte)0xff,(byte)0x26,(byte)0x8f,(byte)0x26,(byte)0x8f,(byte)0x00,(byte)0x45,(byte)0x86,(byte)0xd9,
(byte)0x53,(byte)0x54,(byte)0x41,(byte)0x54,(byte)0x55,(byte)0x53,(byte)0x3a,(byte)0x20,(byte)0x22,(byte)0x6e,(byte)0x65,(byte)0x74,
(byte)0x77,(byte)0x65,(byte)0x72,(byte)0x6b,(byte)0x2d,(byte)0x69,(byte)0x64,(byte)0x22,(byte)0x20,(byte)0x22};
the Serial Monitor displays
UDP program
Configured Ethernet using DHCP OK
My IP address: 192.168.1.177.
UDP begin() OK
Received packet of size 32
From 192.168.1.96, port 59398
Contents: 2 FF 26 8F 26 8F 0 45 86 D9 53 54 41 54 55 53 3A 20 22 6E 65 74 77 65 72 6B 2D 69 64 22 20 22 found
netwerk-id
an alternative and probably simpler technique was suggested in post #3 by @GoForSmoke where you look at the bytes as they arrive for the sequence "STATUS" and the required data then follows