While programming an ATtiny or ATmega, avrdude prints the device signature, in this example it is an ATtiny.
avrdude: Device signature = 0x1e910a
Can I read this signature on a running device using C++ code (avr-gcc)? For ATmega1280 there is a chapter 29.6.10 writing about it, but I'm a bit puzzled by how I can code it in C++.
I want to be able to make the device send its device ID back to the controlling PC, so the PC can make decisions on it.