buf should be uint8_t