/* Unpacks unsigned 8 bit value from the buffer from the offset requested.  */
static int unpack_uint8(struct buf_ctx *buf, uint8_t *val)
/* Unpacks unsigned 8 bit value from the buffer from the offset requested.  */
static int unpack_uint8(struct buf_ctx *buf, uint8_t *val)
{
	NET_DBG(">> cur:%p, end:%p", (void *)buf->cur, (void *)buf->end);
	if ((buf->end - buf->cur) < sizeof(uint8_t)) {
		return -EINVAL;
	}
	*val = *(buf->cur++);
	NET_DBG("<< val:%02x", *val);
	return 0;
}