1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666
|
#include "rd5r_codeplug.hh"
#include "config.hh"
#include "channel.hh"
#include "utils.hh"
#include "logger.hh"
#include <QDateTime>
/* ******************************************************************************************** *
* Implementation of RD5RCodeplug::ChannelElement
* ******************************************************************************************** */
RD5RCodeplug::ChannelElement::ChannelElement(uint8_t *ptr, size_t size)
: RadioddityCodeplug::ChannelElement(ptr, size)
{
// pass...
}
RD5RCodeplug::ChannelElement::ChannelElement(uint8_t *ptr)
: RadioddityCodeplug::ChannelElement(ptr)
{
// pass...
}
void
RD5RCodeplug::ChannelElement::clear() {
RadioddityCodeplug::ChannelElement::clear();
setSquelch(0);
}
unsigned
RD5RCodeplug::ChannelElement::squelch() const {
return getUInt8(Offset::squelch());
}
void
RD5RCodeplug::ChannelElement::setSquelch(unsigned level) {
level = std::min(9u, level);
setUInt8(Offset::squelch(), level);
}
bool
RD5RCodeplug::ChannelElement::fromChannelObj(const Channel *c, Context &ctx, const ErrorStack& err) {
if (! RadioddityCodeplug::ChannelElement::fromChannelObj(c, ctx, err))
return false;
if (c->is<FMChannel>()) {
const FMChannel *ac = c->as<FMChannel>();
if (ac->defaultSquelch())
setSquelch(ctx.config()->settings()->squelch());
else if (ac->squelchDisabled())
setSquelch(0);
else
setSquelch(ac->squelch());
} else {
// If digital channel, reuse global quelch setting
setSquelch(ctx.config()->settings()->squelch());
}
return true;
}
Channel *
RD5RCodeplug::ChannelElement::toChannelObj(Context &ctx, const ErrorStack& err) const {
Channel *ch = RadioddityCodeplug::ChannelElement::toChannelObj(ctx, err);
if (nullptr == ch)
return nullptr;
if (ch->is<FMChannel>()) {
FMChannel *ac = ch->as<FMChannel>();
ac->setSquelch(squelch());
}
return ch;
}
bool
RD5RCodeplug::ChannelElement::linkChannelObj(Channel *c, Context &ctx, const ErrorStack& err) const {
if (! RadioddityCodeplug::ChannelElement::linkChannelObj(c, ctx, err))
return false;
/*
if (c->is<AnalogChannel>()) {
AnalogChannel *ac = c->as<AnalogChannel>();
if (ctx.config()->settings()->squelch() == ac->squelch()) {
ac->setSquelchDefault();
}
}
*/
return true;
}
/* ********************************************************************************************* *
* Implementation of RD5RCodeplug::TimestampElement
* ********************************************************************************************* */
RD5RCodeplug::TimestampElement::TimestampElement(uint8_t *ptr, unsigned size)
: Element(ptr, size)
{
// pass...
}
RD5RCodeplug::TimestampElement::TimestampElement(uint8_t *ptr)
: Element(ptr, size())
{
// pass...
}
RD5RCodeplug::TimestampElement::~TimestampElement() {
// pass...
}
void
RD5RCodeplug::TimestampElement::clear() {
set();
}
QDateTime
RD5RCodeplug::TimestampElement::get() const {
return QDateTime(QDate(getBCD4_be(Offset::year()), getBCD2(Offset::month()), getBCD2(Offset::day())),
QTime(getBCD2(Offset::hour()), getBCD2(Offset::minute())));
}
void
RD5RCodeplug::TimestampElement::set(const QDateTime &ts) {
setBCD4_be(Offset::year(), ts.date().year());
setBCD2(Offset::month(), ts.date().month());
setBCD2(Offset::day(), ts.date().day());
setBCD2(Offset::hour(), ts.time().hour());
setBCD2(Offset::minute(), ts.time().minute());
}
/* ******************************************************************************************** *
* Implementation of RD5RCodeplug::EncryptionElement
* ******************************************************************************************** */
RD5RCodeplug::EncryptionElement::EncryptionElement(uint8_t *ptr)
: RadioddityCodeplug::EncryptionElement(ptr)
{
// pass...
}
bool
RD5RCodeplug::EncryptionElement::isBasicKeySet(unsigned n) const {
if (n>0)
return false;
return RadioddityCodeplug::EncryptionElement::isBasicKeySet(n);
}
QByteArray
RD5RCodeplug::EncryptionElement::basicKey(unsigned n) const {
if (n>0)
return QByteArray();
return QByteArray("\x53\x47\x4c\x39");
}
void
RD5RCodeplug::EncryptionElement::setBasicKey(unsigned n, const QByteArray &key) {
if ((0 != n) || (key != "\x53\x47\x4c\x39")){
logError() << "The RD5R only supports a single fixed DMR basic key '53474c39'.";
return;
}
RD5RCodeplug::EncryptionElement::setBasicKey(n, key);
}
/* ******************************************************************************************** *
* Implementation of RD5RCodeplug
* ******************************************************************************************** */
RD5RCodeplug::RD5RCodeplug(QObject *parent)
: RadioddityCodeplug(parent)
{
addImage("Radioddity RD5R Codeplug");
image(0).addElement(0x00080, 0x07b80);
image(0).addElement(0x08000, 0x16300);
}
void
RD5RCodeplug::clear() {
RadioddityCodeplug::clear();
this->clearTimestamp();
}
bool
RD5RCodeplug::encodeElements(const Flags &flags, Context &ctx, const ErrorStack &err) {
if (! RadioddityCodeplug::encodeElements(flags, ctx, err))
return false;
// Set timestamp
if (! this->encodeTimestamp(err)) {
errMsg(err) << "Cannot encode time-stamp.";
return false;
}
return true;
}
bool
RD5RCodeplug::decodeElements(Context &ctx, const ErrorStack &err) {
if (! RadioddityCodeplug::decodeElements(ctx, err))
return false;
return true;
}
void
RD5RCodeplug::clearTimestamp() {
encodeTimestamp();
}
bool
RD5RCodeplug::encodeTimestamp(const ErrorStack &err) {
Q_UNUSED(err)
TimestampElement(data(Offset::timestamp())).set();
return true;
}
void
RD5RCodeplug::clearGeneralSettings() {
TimestampElement(data(Offset::settings())).clear();
}
bool
RD5RCodeplug::encodeGeneralSettings(const Flags &flags, Context &ctx, const ErrorStack &err) {
Q_UNUSED(err)
GeneralSettingsElement el(data(Offset::settings()));
if (! flags.updateCodeplug())
el.clear();
return el.fromConfig(ctx, err);
}
bool
RD5RCodeplug::decodeGeneralSettings(Context &ctx, const ErrorStack &err) {
return GeneralSettingsElement(data(Offset::settings())).updateConfig(ctx, err);
}
void
RD5RCodeplug::clearButtonSettings() {
ButtonSettingsElement(data(Offset::buttons())).clear();
}
bool
RD5RCodeplug::encodeButtonSettings(Context &ctx, const Flags &flags, const ErrorStack &err) {
Q_UNUSED(flags);
return ButtonSettingsElement(data(Offset::buttons())).encode(ctx, err);
}
bool
RD5RCodeplug::decodeButtonSettings(Context &ctx, const ErrorStack &err) {
return ButtonSettingsElement(data(Offset::buttons())).decode(ctx, err);
}
void
RD5RCodeplug::clearMessages() {
MessageBankElement(data(Offset::messages())).clear();
}
bool
RD5RCodeplug::encodeMessages(Context &ctx, const Flags &flags, const ErrorStack &err) {
if (! MessageBankElement(data(Offset::messages())).encode(ctx, flags, err)) {
errMsg(err) << "Cannot encode preset messages.";
return false;
}
return true;
}
bool
RD5RCodeplug::decodeMessages(Context &ctx, const ErrorStack &err) {
if (! MessageBankElement(data(Offset::messages())).decode(ctx, err)) {
errMsg(err) << "Cannot decode preset messages.";
return false;
}
return true;
}
void
RD5RCodeplug::clearContacts() {
for (unsigned int i=0; i<Limit::contactCount(); i++)
ContactElement(data(Offset::contacts() + i*ContactElement::size())).clear();
}
bool
RD5RCodeplug::encodeContacts(const Flags &flags, Context &ctx, const ErrorStack &err) {
Q_UNUSED(flags); Q_UNUSED(err)
for (unsigned int i=0; i<Limit::contactCount(); i++) {
ContactElement el(data(Offset::contacts() + i*ContactElement::size()));
el.clear();
if (i >= (unsigned int) ctx.count<DMRContact>())
continue;
if (! el.fromContactObj(ctx.get<DMRContact>(i+1), ctx, err)) {
errMsg(err) << "Cannot encode contact '" << ctx.get<DMRContact>(i+1)->name()
<< "' at index " << i+1 << ".";
return false;
}
}
return true;
}
bool
RD5RCodeplug::createContacts(Context &ctx, const ErrorStack &err) {
Q_UNUSED(err)
/* Unpack Contacts */
for (unsigned int i=0; i<Limit::contactCount(); i++) {
ContactElement el(data(Offset::contacts() + i*ContactElement::size()));
if (! el.isValid())
continue;
DMRContact *cont = el.toContactObj(ctx);
ctx.add(cont, i+1); ctx.config()->contacts()->add(cont);
}
return true;
}
void
RD5RCodeplug::clearDTMFContacts() {
for (unsigned int i=0; i<Limit::dtmfContactCount(); i++)
DTMFContactElement(data(Offset::dtmfContacts() + i*DTMFContactElement::size())).clear();
}
bool
RD5RCodeplug::encodeDTMFContacts(const Flags &flags, Context &ctx, const ErrorStack &err) {
Q_UNUSED(flags); Q_UNUSED(err)
for (unsigned int i=0; i<Limit::dtmfContactCount(); i++) {
DTMFContactElement el(data(Offset::dtmfContacts() + i*DTMFContactElement::size()));
el.clear();
if (i >= (unsigned int) ctx.count<DTMFContact>())
continue;
if (! el.fromContactObj(ctx.get<DTMFContact>(i+1), ctx, err)) {
errMsg(err) << "Cannot encode DTMF contact '" << ctx.get<DTMFContact>(i+1)->name()
<< "' at index " << i+1 << ".";
return false;
}
}
return true;
}
bool
RD5RCodeplug::createDTMFContacts(Context &ctx, const ErrorStack &err) {
Q_UNUSED(err)
for (unsigned int i=0; i<Limit::dtmfContactCount(); i++) {
DTMFContactElement el(data(Offset::dtmfContacts()+i*DTMFContactElement::size()));
// If contact is disabled
if (! el.isValid())
continue;
DTMFContact *cont = el.toContactObj(ctx, err);
if (nullptr == cont) {
errMsg(err) << "Cannot decode DTMF contact at index " << i << ".";
return false;
}
ctx.add(cont, i+1); ctx.config()->contacts()->add(cont);
}
return true;
}
void
RD5RCodeplug::clearChannels() {
for (unsigned int b=0,c=0; b<Limit::channelBankCount(); b++) {
uint8_t *ptr = nullptr;
if (0 == b) ptr = data(Offset::channelBank0());
else ptr = data(Offset::channelBank1() + (b-1)*ChannelBankElement::size());
ChannelBankElement bank(ptr); bank.clear();
for (unsigned int i=0; (i<ChannelBankElement::Limit::channelCount())&&(c<Limit::channelCount()); i++, c++)
ChannelElement(bank.get(i)).clear();
}
}
bool
RD5RCodeplug::encodeChannels(const Flags &flags, Context &ctx, const ErrorStack &err) {
Q_UNUSED(flags); Q_UNUSED(err)
for (unsigned int b=0,c=0; b<Limit::channelBankCount(); b++) {
uint8_t *ptr = nullptr;
if (0 == b) ptr = data(Offset::channelBank0());
else ptr = data(Offset::channelBank1() + (b-1)*ChannelBankElement::size());
ChannelBankElement bank(ptr); bank.clear();
for (unsigned int i=0; (i<ChannelBankElement::Limit::channelCount())&&(c<Limit::channelCount()); i++, c++) {
ChannelElement el(bank.get(i));
if (c < ctx.count<Channel>()) {
if (! el.fromChannelObj(ctx.get<Channel>(c+1), ctx, err)) {
errMsg(err) << "Cannot encode channel " << c+1 << " (" << i << " of bank " << b <<").";
return false;
}
bank.enable(i,true);
} else {
el.clear();
bank.enable(i, false);
}
}
}
return true;
}
bool
RD5RCodeplug::createChannels(Context &ctx, const ErrorStack &err) {
Q_UNUSED(err)
for (unsigned int b=0,c=0; b<Limit::channelBankCount(); b++) {
uint8_t *ptr = nullptr;
if (0 == b) ptr = data(Offset::channelBank0());
else ptr = data(Offset::channelBank1() + (b-1)*ChannelBankElement::size());
ChannelBankElement bank(ptr);
for (unsigned int i=0; (i<ChannelBankElement::Limit::channelCount())&&(c<Limit::channelCount()); i++, c++) {
if (! bank.isEnabled(i))
continue;
Channel *ch = ChannelElement(bank.get(i)).toChannelObj(ctx, err);
if (nullptr == ch) {
errMsg(err) << "Cannot create channel at index " << i << ".";
return false;
}
ctx.config()->channelList()->add(ch); ctx.add(ch, c+1);
}
}
return true;
}
bool
RD5RCodeplug::linkChannels(Context &ctx, const ErrorStack &err) {
Q_UNUSED(err)
for (unsigned int b=0,c=0; b<Limit::channelBankCount(); b++) {
uint8_t *ptr = nullptr;
if (0 == b) ptr = data(Offset::channelBank0());
else ptr = data(Offset::channelBank1() + (b-1)*ChannelBankElement::size());
ChannelBankElement bank(ptr);
for (unsigned int i=0; (i<ChannelBankElement::Limit::channelCount())&&(c<Limit::channelCount()); i++, c++) {
if (! bank.isEnabled(i))
continue;
if (!ChannelElement(bank.get(i)).linkChannelObj(ctx.get<Channel>(c+1), ctx, err))
return false;
}
}
return true;
}
void
RD5RCodeplug::clearBootSettings() {
BootSettingsElement(data(Offset::bootSettings())).clear();
}
void
RD5RCodeplug::clearMenuSettings() {
MenuSettingsElement(data(Offset::menuSettings())).clear();
}
void
RD5RCodeplug::clearBootText() {
BootTextElement(data(Offset::bootText())).clear();
}
bool
RD5RCodeplug::encodeBootText(const Flags &flags, Context &ctx, const ErrorStack &err) {
Q_UNUSED(flags);
BootTextElement(data(Offset::bootText())).fromConfig(ctx, err);
return true;
}
bool
RD5RCodeplug::decodeBootText(Context &ctx, const ErrorStack &err) {
BootTextElement(data(Offset::bootText())).updateConfig(ctx, err);
return true;
}
void
RD5RCodeplug::clearVFOSettings() {
ChannelElement(data(Offset::vfoA())).clear();
ChannelElement(data(Offset::vfoB())).clear();
}
void
RD5RCodeplug::clearZones() {
ZoneBankElement bank(data(Offset::zoneBank()));
bank.clear();
for (unsigned int i=0; i<ZoneBankElement::Limit::zoneCount(); i++)
ZoneElement(bank.get(i)).clear();
}
bool
RD5RCodeplug::encodeZones(const Flags &flags, Context &ctx, const ErrorStack &err) {
Q_UNUSED(flags)
ZoneBankElement bank(data(Offset::zoneBank()));
// Pack Zones
for (unsigned int i=0; i<ZoneBankElement::Limit::zoneCount(); i++) {
ZoneElement z(bank.get(i));
if (! ctx.has<Zone>(i+1)) {
bank.enable(i, false);
continue;
}
// Construct from Zone obj
z.fromZoneObjA(ctx.get<Zone>(i+1), ctx, err);
bank.enable(i, true);
}
return true;
}
bool
RD5RCodeplug::createZones(Context &ctx, const ErrorStack &err) {
Q_UNUSED(err)
ZoneBankElement bank(data(Offset::zoneBank()));
for (unsigned int i=0; i<ZoneBankElement::Limit::zoneCount(); i++) {
if (! bank.isEnabled(i))
continue;
ZoneElement z(bank.get(i));
Zone *zone = z.toZoneObj(ctx, err);
ctx.config()->zones()->add(zone);
ctx.add(zone, i+1);
}
return true;
}
bool
RD5RCodeplug::linkZones(Context &ctx, const ErrorStack &err) {
ZoneBankElement bank(data(Offset::zoneBank()));
for (unsigned int i=0; i<ZoneBankElement::Limit::zoneCount(); i++) {
if (! bank.isEnabled(i))
continue;
ZoneElement z(bank.get(i));
Zone *zone = ctx.get<Zone>(i+1);
if (! z.linkZoneObj(zone, ctx)) {
errMsg(err) << "Cannot link zone at index " << i << ".";
return false;
}
}
return true;
}
void
RD5RCodeplug::clearScanLists() {
ScanListBankElement bank(data(Offset::scanListBank())); bank.clear();
for (unsigned int i=0; i<ScanListBankElement::Limit::scanListCount(); i++)
ScanListElement(bank.get(i)).clear();
}
bool
RD5RCodeplug::encodeScanLists(const Flags &flags, Context &ctx, const ErrorStack &err) {
Q_UNUSED(flags);
ScanListBankElement bank(data(Offset::scanListBank()));
for (unsigned int i=0; i<ScanListBankElement::Limit::scanListCount(); i++) {
if (i >= ctx.count<ScanList>()) {
bank.enable(i, false);
continue;
}
if (! ScanListElement(bank.get(i)).fromScanListObj(ctx.get<ScanList>(i+1), ctx, err)) {
errMsg(err) << "Cannot encode scan list at index " << i << ".";
return false;
}
bank.enable(i, true);
}
return true;
}
bool
RD5RCodeplug::createScanLists(Context &ctx, const ErrorStack &err) {
ScanListBankElement bank(data(Offset::scanListBank()));
for (unsigned int i=0; i<ScanListBankElement::Limit::scanListCount(); i++) {
if (! bank.isEnabled(i))
continue;
ScanListElement el(bank.get(i));
ScanList *scan = el.toScanListObj(ctx);
if (nullptr == scan) {
errMsg(err) << "Cannot decode scan list at index " << i+1 << ".";
return false;
}
ctx.config()->scanlists()->add(scan); ctx.add(scan, i+1);
}
return true;
}
bool
RD5RCodeplug::linkScanLists(Context &ctx, const ErrorStack &err) {
ScanListBankElement bank(data(Offset::scanListBank()));
for (unsigned int i=0; i<ScanListBankElement::Limit::scanListCount(); i++) {
if (! bank.isEnabled(i))
continue;
if (! ScanListElement(bank.get(i)).linkScanListObj(ctx.get<ScanList>(i+1), ctx, err)) {
errMsg(err) << "Cannot link scan list '" << ctx.get<ScanList>(i+1)
<< "' at index " << i+1 << ".";
return false;
}
}
return true;
}
void
RD5RCodeplug::clearGroupLists() {
GroupListBankElement bank(data(Offset::groupListBank())); bank.clear();
for (unsigned int i=0; i<GroupListBankElement::Limit::groupListCount(); i++)
GroupListElement(bank.get(i)).clear();
}
bool
RD5RCodeplug::encodeGroupLists(const Flags &flags, Context &ctx, const ErrorStack &err) {
Q_UNUSED(flags);
GroupListBankElement bank(data(Offset::groupListBank())); bank.clear();
for (unsigned int i=0; i<GroupListBankElement::Limit::groupListCount(); i++) {
if (i >= ctx.count<RXGroupList>())
continue;
GroupListElement el(bank.get(i));
el.fromRXGroupListObj(ctx.get<RXGroupList>(i+1), ctx, err);
// Only group calls are encoded
int count = 0;
for (int j=0; j<ctx.get<RXGroupList>(i+1)->count(); j++)
if (DMRContact::GroupCall == ctx.get<RXGroupList>(i+1)->contact(j)->type())
count++;
bank.setContactCount(i, count);
}
return true;
}
bool
RD5RCodeplug::createGroupLists(Context &ctx, const ErrorStack &err) {
GroupListBankElement bank(data(Offset::groupListBank()));
for (unsigned int i=0; i<GroupListBankElement::Limit::groupListCount(); i++) {
if (! bank.isEnabled(i))
continue;
GroupListElement el(bank.get(i));
RXGroupList *list = el.toRXGroupListObj(ctx, err);
ctx.config()->rxGroupLists()->add(list); ctx.add(list, i+1);
}
return true;
}
bool
RD5RCodeplug::linkGroupLists(Context &ctx, const ErrorStack &err) {
GroupListBankElement bank(data(Offset::groupListBank()));
for (unsigned int i=0; i<GroupListBankElement::Limit::groupListCount(); i++) {
if (! bank.isEnabled(i))
continue;
GroupListElement el(bank.get(i));
/*logDebug() << "Link " << bank.contactCount(i) << " members of group list '"
<< ctx.get<RXGroupList>(i+1)->name() << "'.";*/
if (! el.linkRXGroupListObj(bank.contactCount(i), ctx.get<RXGroupList>(i+1), ctx, err)) {
errMsg(err) << "Cannot link group list '" << ctx.get<RXGroupList>(i+1)->name() << "'.";
return false;
}
}
return true;
}
void
RD5RCodeplug::clearEncryption() {
EncryptionElement enc(data(Offset::encryption()));
enc.clear();
}
bool
RD5RCodeplug::encodeEncryption(const Flags &flags, Context &ctx, const ErrorStack &err) {
Q_UNUSED(flags);
clearEncryption();
EncryptionElement enc(data(Offset::encryption()));
return enc.fromCommercialExt(ctx.config()->commercialExtension(), ctx, err);
}
bool
RD5RCodeplug::createEncryption(Context &ctx, const ErrorStack &err) {
Q_UNUSED(err);
EncryptionElement enc(data(Offset::encryption()));
if (EncryptionElement::PrivacyType::None == enc.privacyType())
return true;
return enc.updateCommercialExt(ctx, err);
}
bool
RD5RCodeplug::linkEncryption(Context &ctx, const ErrorStack &err) {
Q_UNUSED(ctx); Q_UNUSED(err);
return true;
}
|