本文整理汇总了C++中Print::print方法的典型用法代码示例。如果您正苦于以下问题:C++ Print::print方法的具体用法?C++ Print::print怎么用?C++ Print::print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Print
的用法示例。
在下文中一共展示了Print::print方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printTo
size_t IPAddress::printTo(Print& p) const {
size_t n = 0;
if (!isSet())
return p.print(F("(IP unset)"));
#if LWIP_IPV6
if (isV6()) {
int count0 = 0;
for (int i = 0; i < 8; i++) {
uint16_t bit = PP_NTOHS(raw6()[i]);
if (bit || count0 < 0) {
n += p.printf("%x", bit);
if (count0 > 0)
// no more hiding 0
count0 = -8;
} else
count0++;
if ((i != 7 && count0 < 2) || count0 == 7)
n += p.print(':');
}
return n;
}
#endif
for(int i = 0; i < 4; i++) {
n += p.print((*this)[i], DEC);
if (i != 3)
n += p.print('.');
}
return n;
}
示例2: motor_init
void slight_StepperManager::motor_init(Print &out) {
out.println(F("setup stepper motor:"));
// init motor
out.println(F("\t set:"));
out.println(F("\t MICROSTEP_8"));
out.println(F("\t max speed 200 steps/s"));
out.println(F("\t acceleration 200 steps/s^2"));
motor.begin(MICROSTEP_8, 200, 200);
out.println(F("\t limits:"));
// int32_t limit = 12800;
motor.forwardLimit = calibration_limit;
motor.reverseLimit = -calibration_limit;
// print current/new limits
out.print(F("\t * forwardLimit: "));
out.print(motor.forwardLimit);
out.println();
out.print(F("\t * reverseLimit: "));
out.print(motor.reverseLimit);
out.println();
// motor.moveTo(6400);
out.println(F("\t finished."));
}
示例3: print_channel_state
void slave_status::print_channel_state(Print& out, const channel_state_t& state)
{
switch (state)
{
case channel_working:
out.print("Working Normally");
break;
case channel_disconnected:
out.print("Disconnected / Solenoid Not Found");
break;
case channel_failed_short:
out.print("Short-Circuited");
break;
case channel_failed_open:
out.print("Failed Open-Circuit");
break;
default:
out.print("Unknown / Invalid Channel Status");
break;
}
}
示例4: 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();
}
示例5: print
void StringMap::print(Print &client, StringMapKey key) const {
if (!this->contains(key)) return;
char * s = this->find(key);
if (!s) return;
if (isProgmem(key))
client.print((__FlashStringHelper *)s);
else
client.print(s);
}
示例6: printTo
size_t IPAddress::printTo(Print& p) const {
size_t n = 0;
for(int i = 0; i < 3; i++) {
n += p.print(_address.bytes[i], DEC);
n += p.print('.');
}
n += p.print(_address.bytes[3], DEC);
return n;
}
示例7: 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());
}
}
示例8: print_error
void slight_StepperManager::print_error(Print &out, error_t error) {
switch (error) {
case ERROR_none: {
out.print(F("none"));
} break;
case ERROR_timeout: {
out.print(F("timeout"));
} break;
case ERROR_limitswitch_wrong_dir: {
// out.print(F("LimitSw wrong dir"));
out.print(F("LimitSwDirection"));
} break;
case ERROR_limitswitchs: {
out.print(F("LimitSw blocked"));
} break;
case ERROR_motorstart: {
out.print(F("motor start"));
} break;
case ERROR_motorstop: {
out.print(F("motor stop"));
} break;
case ERROR_calibrating: {
out.print(F("calibrating"));
} break;
case ERROR_mechanics_moved: {
out.print(F("mechanics moved"));
} break;
case ERROR_emergencystop: {
out.print(F("emergency stop"));
} break;
}
}
示例9: printLastError
void PBBP::printLastError(Print &p) {
if (this->last_error < sizeof(error_code_str) / sizeof(*error_code_str))
p.print(error_code_str[this->last_error]);
else
p.print(this->last_error);
if (this->last_error == NACK) {
p.print(", slave error code: 0x");
p.print(this->last_slave_error, HEX);
}
}
示例10:
size_t IP64Address::printTo(Print& p) const
{
size_t n = 0;
for (int i =0; i < 7; i++)
{
n += p.print(_address[i], DEC);
n += p.print('.');
}
n += p.print(_address[7], DEC);
return n;
}
示例11: printTo
size_t IPAddress::printTo(Print& p) const
{
size_t n = 0;
for (int i = 0; i < 4; i++)
{
if (n)
n += p.print('.');
n += p.print((*this)[i], DEC);
}
return n;
}
示例12: printTo
size_t IPAddress::printTo(Print& p) const
{
size_t n = 0;
for (int i =0; i < 3; i++)
{
n += p.print(((uint8_t*) & _address)[i], DEC);
n += p.print('.');
}
n += p.print(((uint8_t*)&_address)[3], DEC);
return n;
}
示例13: printResponseCb
void printResponseCb(AtCommandResponse& at, uintptr_t data) {
Print *p = (Print*)data;
p->println("AtCommandResponse received:");
p->print(F(" Command: "));
p->write(at.getCommand(), 2);
p->println();
printField(p, F(" Status: 0x"), at.getStatus());
if (at.getValueLength()) {
p->print(F(" Value: "));
printHex(*p, at.getValue(), at.getValueLength(), F(" "), NULL);
p->println();
}
}
示例14: printTo
size_t MACAddress::printTo(Print& p) const
{
size_t n = 0;
for (int i =0; i < 7; i++)
{
if(_address[i]<16)
n += p.print("0");
n += p.print(_address[i], HEX);
n += p.print(':');
}
if(_address[7]<16)
n += p.print("0");
n += p.print(_address[7], HEX);
return n;
}
示例15: printTo
size_t MACAddress::printTo(Print& p) const
{
size_t n = 0;
for (int i =0; i < 5; i++)
{
if (_address[i] < 0x10)
n += p.print('0');
n += p.print(_address[i], HEX);
n += p.print(':');
}
if (_address[5] < 0x10)
n += p.print('0');
n += p.print(_address[5], HEX);
return n;
}