本文整理汇总了C++中Print::println方法的典型用法代码示例。如果您正苦于以下问题:C++ Print::println方法的具体用法?C++ Print::println怎么用?C++ Print::println使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Print
的用法示例。
在下文中一共展示了Print::println方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printResponseCb
void printResponseCb(ZBTxStatusResponse& status, uintptr_t data) {
Print *p = (Print*)data;
p->println(F("ZBTxStatusResponse received:"));
printField(p, F(" FrameId: 0x"), status.getFrameId());
printField(p, F(" To: 0x"), status.getRemoteAddress());
printField(p, F(" Delivery status: 0x"), status.getDeliveryStatus());
printField(p, F(" Discovery status: 0x"), status.getDiscoveryStatus());
}
示例2: PrintValue
void CApplicationMonitor::PrintValue(Print &rDestination, const __FlashStringHelper *pLabel,
uint32_t uValue, uint8_t uRadix, bool bNewLine) const
{
rDestination.print(pLabel);
rDestination.print(uValue, uRadix);
if (bNewLine)
rDestination.println();
}
示例3: printErrorCb
void printErrorCb(RemoteAtCommandResponse& r, uintptr_t data) {
Print *p = (Print*)data;
if (!r.isOk()) {
p->print(F("Error sending remote "));
p->write(r.getCommand(), 2);
p->print(F(" command. Status: "));
p->println(r.getStatus());
}
}
示例4: printRawResponseCb
void printRawResponseCb(XBeeResponse& response, uintptr_t data) {
Print *p = (Print*)data;
p->print("Response received: ");
// Reconstruct the original packet
uint8_t header[] = {START_BYTE, response.getMsbLength(), response.getLsbLength(), response.getApiId()};
printHex(*p, header, sizeof(header), F(" "), NULL);
p->write(' ');
printHex(*p, response.getFrameData(), response.getFrameDataLength(), F(" "), NULL);
p->println();
}
示例5: Status
void MessageController::Status(Command& cmd, Print& output)
{
SendOkBegin(output);
output.print(F(", \"message\": { \"text\": "));
PrintJsonQuotedString(output, _message.GetText());
output.print(F(", \"done \": "));
output.print(_message.IsDone() ? "true" : "false");
output.print(F(" }, \"alert\": { \"text\": "));
PrintJsonQuotedString(output, _alert.GetText());
output.print(F(", \"done \": "));
output.print(_message.IsDone() ? "true" : "false");
output.println(F(" } }"));
}
示例6: debug
void debug(Stream &in, Print& out) {
int command = in.read();
switch(command) {
case 'D':
setDateFromStream(in, out);
case 'd':
printDate(out);
break;
case 'T':
setTimeFromStream(in, out);
case 't':
printTime(out);
break;
case 'e':
out.println("Exit");
CLEAR_FLAG(mode, DEBUG_FLAG);
break;
default:
if(command > ' ') {
out.println("Invalid command");
}
}
}
示例7:
void ESP8266WiFiClass::printDiag(Print& p)
{
const char* modes[] = {"NULL", "STA", "AP", "STA+AP"};
p.print("Mode: ");
p.println(modes[wifi_get_opmode()]);
const char* phymodes[] = {"", "B", "G", "N"};
p.print("PHY mode: ");
p.println(phymodes[(int) wifi_get_phy_mode()]);
p.print("Channel: ");
p.println(wifi_get_channel());
p.print("AP id: ");
p.println(wifi_station_get_current_ap_id());
p.print("Status: ");
p.println(wifi_station_get_connect_status());
p.print("Auto connect: ");
p.println(wifi_station_get_auto_connect());
static struct station_config conf;
wifi_station_get_config(&conf);
const char* ssid = reinterpret_cast<const char*>(conf.ssid);
p.print("SSID (");
p.print(strlen(ssid));
p.print("): ");
p.println(ssid);
const char* passphrase = reinterpret_cast<const char*>(conf.password);
p.print("Passphrase (");
p.print(strlen(passphrase));
p.print("): ");
p.println(passphrase);
p.print("BSSID set: ");
p.println(conf.bssid_set);
}
示例8: Poll
void SensirionDriver::Poll(Print &data_transmitter) {
uint8_t buffer[4];
ReadBuffer(0x00, buffer, 4);
uint16_t temperature = buffer[0]<<8 | buffer[1];
uint16_t humidity = buffer[2]<<8 | buffer[3];
data_transmitter.print("<");
data_transmitter.print(DeviceAddress(), HEX);
data_transmitter.print(", ");
data_transmitter.print(temperature, DEC);
data_transmitter.print(", ");
data_transmitter.print(humidity, DEC);
data_transmitter.println(">");
}
示例9: printTo
size_t CosmFeed::printTo(Print& aPrint) const
{
int len = 0;
len += aPrint.println("{");
len += aPrint.println("\"version\":\"1.0.0\",");
len += aPrint.println("\"datastreams\" : [");
for (int j =0; j < _datastreamsCount; j++)
{
len += aPrint.print(_datastreams[j]);
if (j == _datastreamsCount-1)
{
// Last time through
len += aPrint.println();
}
else
{
len += aPrint.println(",");
}
}
len += aPrint.println("]");
len += aPrint.println("}");
return len;
}
示例10: enterDebugMode
void enterDebugMode(Print &out) {
SET_FLAG(mode, DEBUG_FLAG);
out.println("DEBUG");
}
示例11: newline
void JsonPrinter::newline(Print& printer) {
printer.println();
}
示例12: print
/**
* Print out crash information that has been previusly saved in EEPROM
* @param outputDev Print& Optional. Where to print: Serial, Serial, WiFiClient, etc.
*/
void EspSaveCrash::print(Print& outputDev)
{
// Note that 'EEPROM.begin' method is reserving a RAM buffer
// The buffer size is SAVE_CRASH_EEPROM_OFFSET + SAVE_CRASH_SPACE_SIZE
EEPROM.begin(SAVE_CRASH_EEPROM_OFFSET + SAVE_CRASH_SPACE_SIZE);
byte crashCounter = EEPROM.read(SAVE_CRASH_EEPROM_OFFSET + SAVE_CRASH_COUNTER);
if (crashCounter == 0)
{
outputDev.println("No any crashes saved");
return;
}
outputDev.println("Crash information recovered from EEPROM");
int16_t readFrom = SAVE_CRASH_EEPROM_OFFSET + SAVE_CRASH_DATA_SETS;
for (byte k = 0; k < crashCounter; k++)
{
uint32_t crashTime;
EEPROM.get(readFrom + SAVE_CRASH_CRASH_TIME, crashTime);
outputDev.printf("Crash # %d at %ld ms\n", k + 1, crashTime);
outputDev.printf("Reason of restart: %d\n", EEPROM.read(readFrom + SAVE_CRASH_RESTART_REASON));
outputDev.printf("Exception cause: %d\n", EEPROM.read(readFrom + SAVE_CRASH_EXCEPTION_CAUSE));
uint32_t epc1, epc2, epc3, excvaddr, depc;
EEPROM.get(readFrom + SAVE_CRASH_EPC1, epc1);
EEPROM.get(readFrom + SAVE_CRASH_EPC2, epc2);
EEPROM.get(readFrom + SAVE_CRASH_EPC3, epc3);
EEPROM.get(readFrom + SAVE_CRASH_EXCVADDR, excvaddr);
EEPROM.get(readFrom + SAVE_CRASH_DEPC, depc);
outputDev.printf("epc1=0x%08x epc2=0x%08x epc3=0x%08x excvaddr=0x%08x depc=0x%08x\n", epc1, epc2, epc3, excvaddr, depc);
uint32_t stackStart, stackEnd;
EEPROM.get(readFrom + SAVE_CRASH_STACK_START, stackStart);
EEPROM.get(readFrom + SAVE_CRASH_STACK_END, stackEnd);
outputDev.println(">>>stack>>>");
int16_t currentAddress = readFrom + SAVE_CRASH_STACK_TRACE;
int16_t stackLength = stackEnd - stackStart;
uint32_t stackTrace;
for (int16_t i = 0; i < stackLength; i += 0x10)
{
outputDev.printf("%08x: ", stackStart + i);
for (byte j = 0; j < 4; j++)
{
EEPROM.get(currentAddress, stackTrace);
outputDev.printf("%08x ", stackTrace);
currentAddress += 4;
if (currentAddress - SAVE_CRASH_EEPROM_OFFSET > SAVE_CRASH_SPACE_SIZE)
{
outputDev.println("\nIncomplete stack trace saved!");
goto eepromSpaceEnd;
}
}
outputDev.println();
}
eepromSpaceEnd:
outputDev.println("<<<stack<<<");
readFrom = readFrom + SAVE_CRASH_STACK_TRACE + stackLength;
}
int16_t writeFrom;
EEPROM.get(SAVE_CRASH_EEPROM_OFFSET + SAVE_CRASH_WRITE_FROM, writeFrom);
EEPROM.end();
// is there free EEPROM space avialable to save data for next crash?
if (writeFrom + SAVE_CRASH_STACK_TRACE > SAVE_CRASH_SPACE_SIZE)
{
outputDev.println("No more EEPROM space available to save crash information!");
}
else
{
outputDev.printf("EEPROM space available: 0x%04x bytes\n", SAVE_CRASH_SPACE_SIZE - writeFrom);
}
}
示例13: halt
void halt(Print & p,
const __FlashStringHelper * s) {
p.println(s);
while (true);
}