/* Read data from the transport channel until a frame delimiter is found.  */
static int read_frame_delimiter(struct xbee_driver_t *self_p)
/* Read data from the transport channel until a frame delimiter is found.  */
static int read_frame_delimiter(struct xbee_driver_t *self_p)
{
    int res;
    uint8_t byte;
    while (1) {
        res = read_byte(self_p, &byte);
        if (res != sizeof(byte)) {
            break;
        }
        if (byte == FRAME_DELIMITER) {
            res = 0;
            break;
        }
    }
    return (res);
}