Generate and Parse CoAP packets