F.J Kong's Blog

BRAVO HOTEL ONE SIERRA CHARLIE WHISKEY

April, 2016

memory buffer as FILE*

http://stackoverflow.com/questions/539537/memory-buffer-as-file #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { FILE *f = fopen(“/dev/null”, “w”); int i; int written = 0; char *buf = malloc(100000); setbuffer(f, buf, 100000); for (i = 0; i < 1000; i++) { written += fprintf(f, “Number %d\n”, i); } for (i = 0; i < written; i++) { printf(“%c”, […]

多个串口节点名称不固定的解决方法 How to identify multiple USB-serial adapters under Ubuntu

copy from here:http://stackoverflow.com/questions/4800099/how-to-identify-multiple-usb-serial-adapters-under-ubuntu-10-1 The USB “KERNEL” was not enough in my case, but I found the port number. I am aware that what I’m proposing now might be considered an insane hack, but it works for me.. for now.. I would actually be pleased to see a more elegant suggestion that accomplish something similar.. So… […]