MCPcopy Create free account
hub / github.com/attermann/microReticulum / encode_error

Method encode_error

src/microReticulum/Provisioning/Provisioning.cpp:393–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391 }
392
393 Bytes Provisioner::encode_error(opid_t op_id, seq_t seq, ErrorCode code, const char* msg) {
394 return pack_response((opid_t)Op::Error, seq, [&](MsgPack::Packer& p) {
395 p.serialize(MsgPack::map_size_t(msg ? 2 : 1));
396 p.serialize((uint16_t)Key::ErrorCodeKey);
397 p.serialize((ferror_t)code);
398 if (msg) {
399 p.serialize((uint16_t)Key::ErrorMessage);
400 p.serialize(msg);
401 }
402 });
403 }
404
405 Bytes Provisioner::encode_ack(opid_t op_id, seq_t seq) {
406 return pack_response(op_id, seq, nullptr);

Callers

nothing calls this directly

Calls 1

pack_responseFunction · 0.85

Tested by

no test coverage detected