Adapted to nCoAP release 1.0.1