void ModemGSM::SendCommand(const char *__fmt, ...)
{
	char buffer[101];
	va_list arglist;
	
	va_start( arglist, __fmt );
    vsprintf_P(buffer, __fmt, arglist );
    va_end( arglist );	

	FSerial->println(buffer);
}
示例#2
0
/*!
 * \brief Write formatted data to a string.
 *
 * Similar to sprintf() except that the format string is located in
 * program memory.
 *
 * \param buffer Pointer to a buffer that receives the output string.
 * \param fmt    Format string in program space containing conversion 
 *               specifications.
 *
 * \return The number of characters written or a negative value to
 *         indicate an error.
 */
int sprintf_P(char *buffer, PGM_P fmt, ...)
{
    int rc;
    va_list ap;

    va_start(ap, fmt);
    /* Bugfix by Ralph Mason. */
    rc = vsprintf_P(buffer, (char *) fmt, ap);
    va_end(ap);

    return rc;
}