fix buffer type in function read(uint8_t* buf, size_t size) to char *
add missing right curly bracket