当前位置: 首页>>代码示例>>C++>>正文


C++ Print::println方法代码示例

本文整理汇总了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());
}
开发者ID:Introsys,项目名称:fresh,代码行数:8,代码来源:Printers.cpp

示例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();
}
开发者ID:UnforeseenOcean,项目名称:Highsight,代码行数:8,代码来源:ApplicationMonitor.cpp

示例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());
	}
}
开发者ID:Introsys,项目名称:fresh,代码行数:9,代码来源:Printers.cpp

示例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();
}
开发者ID:Introsys,项目名称:fresh,代码行数:10,代码来源:Printers.cpp

示例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(" } }"));
}
开发者ID:zabbius,项目名称:smarthome,代码行数:13,代码来源:MessageController.cpp

示例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"); 
    }
  }
}
开发者ID:tuofeichen,项目名称:SmartTree-Electrical,代码行数:24,代码来源:debug.cpp

示例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);

}
开发者ID:Red680812,项目名称:WeMos_Boards,代码行数:41,代码来源:ESP8266WiFi.cpp

示例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(">");
}
开发者ID:herrera-luis-alberto,项目名称:OpenSonde,代码行数:15,代码来源:Sensirion.cpp

示例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;
}
开发者ID:Giuseppe33,项目名称:Arduino-Sketchbook,代码行数:23,代码来源:CosmFeed.cpp

示例10: enterDebugMode

void enterDebugMode(Print &out) {
  SET_FLAG(mode, DEBUG_FLAG);
  out.println("DEBUG");
}
开发者ID:tuofeichen,项目名称:SmartTree-Electrical,代码行数:4,代码来源:debug.cpp

示例11: newline

void JsonPrinter::newline(Print& printer) {
    printer.println();
}
开发者ID:rbender,项目名称:SimpleSensors,代码行数:3,代码来源:JsonPrinter.cpp

示例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);
  }
}
开发者ID:gpambrozio,项目名称:arduino,代码行数:77,代码来源:EspSaveCrash.cpp

示例13: halt

void halt(Print & p,
    const __FlashStringHelper * s) {
    p.println(s);
    while (true);
}
开发者ID:c22shen,项目名称:ssms-remix,代码行数:5,代码来源:coordinator_1221.c


注:本文中的Print::println方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。