wrote device.c