/* Get one byte from the specified position in a pbuf */
int pbuf_try_get_at(const struct pbuf *p, u16_t offset)
/* Get one byte from the specified position in a pbuf */
int pbuf_try_get_at(const struct pbuf *p, u16_t offset)
{
  u16_t q_idx;
  const struct pbuf* q = pbuf_skip_const(p, offset, &q_idx);
  if ((q != NULL) && (q->len > q_idx)) {
    return ((u8_t*)q->payload)[q_idx];
  }
  return -1;
}