Added support of the write register (P) command.

Packet format PN=XX.., where N is the register number and XX.. is the value to
write to the register.