This class populates network send and receive buffers.
This class provides formatted printing into memory. Users can use it to write into send buffers.
Nota: PGM_P: is a pointer to a string in program space (defined in the source code, updated to PROGMEM)
Format string
Format | Parameter | Output |
$D | uint16_t | Decimal representation |
$T ¤ | double | Decimal representation with 3 digits after decimal sign ([-]d.ddd) |
$H | uint16_t | Hexadecimal value of lsb (from 00 to ff) |
$L | long | Decimal representation |
$S | const char* | Copy null terminated string from main memory |
$F | PGM_P | Copy null terminated string from program space |
$E | byte* | Copy null terminated string from EEPROM space |
$$ | none | '$' |
¤ Available only if FLOATEMIT is defined
Examples
uint16_t ddd = 123;
double ttt = 1.23;
uint16_t hhh = 0xa4;
long lll = 123456789;
char * sss;
char fff[] PROGMEM = "MyMemory";
sss[0] = 'G';
sss[1] = 'P';
sss[2] = 'L';
sss[3] = 0;
buf.emit_p( PSTR("ddd=$D\n"), ddd );
buf.emit_p( PSTR("ttt=$T\n"), ttt );
buf.emit_p( PSTR("hhh=$H\n"), hhh );
buf.emit_p( PSTR("lll=$L\n"), lll );
buf.emit_p( PSTR("sss=$S\n"), sss );
buf.emit_p( PSTR("fff=$F\n"), fff );
- Examples:
- etherNode.ino, JeeUdp.ino, and rbbb_server.ino.