Arduino to Openframeworks size of UDP packet

Hi, I am trying to replicate a library from arduino in OF. The UDP in Arduino works a little differently and I am stuck trying to replicate a few functions.

I need to know the size of the udp message, but from looking at the ofxUDPmanager you have to specify the size of the message you are receiving. The function in arduino is

packetSize = _Udp.parsePacket();
		if (_Udp.available() && packetSize==20)   {  	

				// Read the response packet. We will only subtract the session ID

Is there a way to achieve this with ofxNetwork?

There are also a few lines of code that make no sense to me, if anyone has the time to explain- I tried to search but I dont understand the syntax at all so I don’t know what I am looking for.

boolean command_ACK = command & B00001000 ? true : false;


uint16_t packetLength = word(_packetBuffer[0] & B00000111, _packetBuffer[1]);

I understand in the second one word is used to make a 16-bit unsigned number from 2 bytes but I don’t understand what the second half of the first argument in the casting & B00000111 I guess it is the same syntax as used above.

To give more context the library I am trying to re-create is here.