001/* 002 * Copyright (C) Cross The Road Electronics. All rights reserved. 003 * License information can be found in CTRE_LICENSE.txt 004 * For support and suggestions contact support@ctr-electronics.com or file 005 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases 006 */ 007package com.ctre.phoenixpro.configs; 008 009import com.ctre.phoenix6.StatusCode; 010import com.ctre.phoenixpro.hardware.DeviceIdentifier; 011import com.ctre.phoenix6.configs.jni.ConfigJNI; 012 013/** 014 * Class description for the Talon FX integrated motor controller that runs on 015 * associated Falcon motors. 016 * 017 * This handles the configurations for the {@link com.ctre.phoenixpro.hardware.TalonFX} 018 * 019 * @deprecated Classes in the phoenixpro package will be removed in 2024. 020 * Users should instead use classes from the phoenix6 package. 021 */ 022@Deprecated(forRemoval = true) 023public class TalonFXConfigurator extends ParentConfigurator 024{ 025 public TalonFXConfigurator (DeviceIdentifier id) 026 { 027 super(id); 028 } 029 030 /** 031 * Refreshes the values of the specified config group. 032 * <p> 033 * This will wait up to {@link #defaultTimeoutSeconds}. 034 * <p> 035 * Call to refresh the selected configs from the device. 036 * 037 * @param configs The configs to refresh 038 * @return StatusCode of refreshing the configs 039 */ 040 public StatusCode refresh(TalonFXConfiguration configs) 041 { 042 return refresh(configs, defaultTimeoutSeconds); 043 } 044 045 /** 046 * Refreshes the values of the specified config group. 047 * <p> 048 * Call to refresh the selected configs from the device. 049 * 050 * @param configs The configs to refresh 051 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 052 * @return StatusCode of refreshing the configs 053 */ 054 public StatusCode refresh(TalonFXConfiguration configs, double timeoutSeconds) 055 { 056 StringBuilder serializedString = new StringBuilder(); 057 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 058 if (err == StatusCode.OK) { 059 /* Only deserialize if we successfully got configs */ 060 configs.deserialize(serializedString.toString()); 061 } 062 return err; 063 } 064 065 /** 066 * Applies the contents of the specified config to the device. 067 * <p> 068 * This will wait up to {@link #defaultTimeoutSeconds}. 069 * <p> 070 * Call to apply the selected configs. 071 * 072 * @param configs Configs to apply against. 073 * @return StatusCode of the set command 074 */ 075 public StatusCode apply(TalonFXConfiguration configs) 076 { 077 return apply(configs, defaultTimeoutSeconds); 078 } 079 080 /** 081 * Applies the contents of the specified config to the device. 082 * <p> 083 * Call to apply the selected configs. 084 * 085 * @param configs Configs to apply against. 086 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 087 * @return StatusCode of the set command 088 */ 089 public StatusCode apply(TalonFXConfiguration configs, double timeoutSeconds) 090 { 091 return setConfigsPrivate(configs.serialize(), timeoutSeconds, configs.FutureProofConfigs, false); 092 } 093 094 095 /** 096 * Refreshes the values of the specified config group. 097 * <p> 098 * This will wait up to {@link #defaultTimeoutSeconds}. 099 * <p> 100 * Call to refresh the selected configs from the device. 101 * 102 * @param configs The configs to refresh 103 * @return StatusCode of refreshing the configs 104 */ 105 public StatusCode refresh(Slot0Configs configs) 106 { 107 return refresh(configs, defaultTimeoutSeconds); 108 } 109 110 /** 111 * Refreshes the values of the specified config group. 112 * <p> 113 * Call to refresh the selected configs from the device. 114 * 115 * @param configs The configs to refresh 116 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 117 * @return StatusCode of refreshing the configs 118 */ 119 public StatusCode refresh(Slot0Configs configs, double timeoutSeconds) 120 { 121 StringBuilder serializedString = new StringBuilder(); 122 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 123 if (err == StatusCode.OK) { 124 /* Only deserialize if we successfully got configs */ 125 configs.deserialize(serializedString.toString()); 126 } 127 return err; 128 } 129 130 /** 131 * Applies the contents of the specified config to the device. 132 * <p> 133 * This will wait up to {@link #defaultTimeoutSeconds}. 134 * <p> 135 * Call to apply the selected configs. 136 * 137 * @param configs Configs to apply against. 138 * @return StatusCode of the set command 139 */ 140 public StatusCode apply(Slot0Configs configs) 141 { 142 return apply(configs, defaultTimeoutSeconds); 143 } 144 145 /** 146 * Applies the contents of the specified config to the device. 147 * <p> 148 * Call to apply the selected configs. 149 * 150 * @param configs Configs to apply against. 151 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 152 * @return StatusCode of the set command 153 */ 154 public StatusCode apply(Slot0Configs configs, double timeoutSeconds) 155 { 156 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 157 } 158 159 160 /** 161 * Refreshes the values of the specified config group. 162 * <p> 163 * This will wait up to {@link #defaultTimeoutSeconds}. 164 * <p> 165 * Call to refresh the selected configs from the device. 166 * 167 * @param configs The configs to refresh 168 * @return StatusCode of refreshing the configs 169 */ 170 public StatusCode refresh(Slot1Configs configs) 171 { 172 return refresh(configs, defaultTimeoutSeconds); 173 } 174 175 /** 176 * Refreshes the values of the specified config group. 177 * <p> 178 * Call to refresh the selected configs from the device. 179 * 180 * @param configs The configs to refresh 181 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 182 * @return StatusCode of refreshing the configs 183 */ 184 public StatusCode refresh(Slot1Configs configs, double timeoutSeconds) 185 { 186 StringBuilder serializedString = new StringBuilder(); 187 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 188 if (err == StatusCode.OK) { 189 /* Only deserialize if we successfully got configs */ 190 configs.deserialize(serializedString.toString()); 191 } 192 return err; 193 } 194 195 /** 196 * Applies the contents of the specified config to the device. 197 * <p> 198 * This will wait up to {@link #defaultTimeoutSeconds}. 199 * <p> 200 * Call to apply the selected configs. 201 * 202 * @param configs Configs to apply against. 203 * @return StatusCode of the set command 204 */ 205 public StatusCode apply(Slot1Configs configs) 206 { 207 return apply(configs, defaultTimeoutSeconds); 208 } 209 210 /** 211 * Applies the contents of the specified config to the device. 212 * <p> 213 * Call to apply the selected configs. 214 * 215 * @param configs Configs to apply against. 216 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 217 * @return StatusCode of the set command 218 */ 219 public StatusCode apply(Slot1Configs configs, double timeoutSeconds) 220 { 221 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 222 } 223 224 225 /** 226 * Refreshes the values of the specified config group. 227 * <p> 228 * This will wait up to {@link #defaultTimeoutSeconds}. 229 * <p> 230 * Call to refresh the selected configs from the device. 231 * 232 * @param configs The configs to refresh 233 * @return StatusCode of refreshing the configs 234 */ 235 public StatusCode refresh(Slot2Configs configs) 236 { 237 return refresh(configs, defaultTimeoutSeconds); 238 } 239 240 /** 241 * Refreshes the values of the specified config group. 242 * <p> 243 * Call to refresh the selected configs from the device. 244 * 245 * @param configs The configs to refresh 246 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 247 * @return StatusCode of refreshing the configs 248 */ 249 public StatusCode refresh(Slot2Configs configs, double timeoutSeconds) 250 { 251 StringBuilder serializedString = new StringBuilder(); 252 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 253 if (err == StatusCode.OK) { 254 /* Only deserialize if we successfully got configs */ 255 configs.deserialize(serializedString.toString()); 256 } 257 return err; 258 } 259 260 /** 261 * Applies the contents of the specified config to the device. 262 * <p> 263 * This will wait up to {@link #defaultTimeoutSeconds}. 264 * <p> 265 * Call to apply the selected configs. 266 * 267 * @param configs Configs to apply against. 268 * @return StatusCode of the set command 269 */ 270 public StatusCode apply(Slot2Configs configs) 271 { 272 return apply(configs, defaultTimeoutSeconds); 273 } 274 275 /** 276 * Applies the contents of the specified config to the device. 277 * <p> 278 * Call to apply the selected configs. 279 * 280 * @param configs Configs to apply against. 281 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 282 * @return StatusCode of the set command 283 */ 284 public StatusCode apply(Slot2Configs configs, double timeoutSeconds) 285 { 286 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 287 } 288 289 290 /** 291 * Refreshes the values of the specified config group. 292 * <p> 293 * This will wait up to {@link #defaultTimeoutSeconds}. 294 * <p> 295 * Call to refresh the selected configs from the device. 296 * 297 * @param configs The configs to refresh 298 * @return StatusCode of refreshing the configs 299 */ 300 public StatusCode refresh(MotorOutputConfigs configs) 301 { 302 return refresh(configs, defaultTimeoutSeconds); 303 } 304 305 /** 306 * Refreshes the values of the specified config group. 307 * <p> 308 * Call to refresh the selected configs from the device. 309 * 310 * @param configs The configs to refresh 311 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 312 * @return StatusCode of refreshing the configs 313 */ 314 public StatusCode refresh(MotorOutputConfigs configs, double timeoutSeconds) 315 { 316 StringBuilder serializedString = new StringBuilder(); 317 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 318 if (err == StatusCode.OK) { 319 /* Only deserialize if we successfully got configs */ 320 configs.deserialize(serializedString.toString()); 321 } 322 return err; 323 } 324 325 /** 326 * Applies the contents of the specified config to the device. 327 * <p> 328 * This will wait up to {@link #defaultTimeoutSeconds}. 329 * <p> 330 * Call to apply the selected configs. 331 * 332 * @param configs Configs to apply against. 333 * @return StatusCode of the set command 334 */ 335 public StatusCode apply(MotorOutputConfigs configs) 336 { 337 return apply(configs, defaultTimeoutSeconds); 338 } 339 340 /** 341 * Applies the contents of the specified config to the device. 342 * <p> 343 * Call to apply the selected configs. 344 * 345 * @param configs Configs to apply against. 346 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 347 * @return StatusCode of the set command 348 */ 349 public StatusCode apply(MotorOutputConfigs configs, double timeoutSeconds) 350 { 351 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 352 } 353 354 355 /** 356 * Refreshes the values of the specified config group. 357 * <p> 358 * This will wait up to {@link #defaultTimeoutSeconds}. 359 * <p> 360 * Call to refresh the selected configs from the device. 361 * 362 * @param configs The configs to refresh 363 * @return StatusCode of refreshing the configs 364 */ 365 public StatusCode refresh(CurrentLimitsConfigs configs) 366 { 367 return refresh(configs, defaultTimeoutSeconds); 368 } 369 370 /** 371 * Refreshes the values of the specified config group. 372 * <p> 373 * Call to refresh the selected configs from the device. 374 * 375 * @param configs The configs to refresh 376 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 377 * @return StatusCode of refreshing the configs 378 */ 379 public StatusCode refresh(CurrentLimitsConfigs configs, double timeoutSeconds) 380 { 381 StringBuilder serializedString = new StringBuilder(); 382 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 383 if (err == StatusCode.OK) { 384 /* Only deserialize if we successfully got configs */ 385 configs.deserialize(serializedString.toString()); 386 } 387 return err; 388 } 389 390 /** 391 * Applies the contents of the specified config to the device. 392 * <p> 393 * This will wait up to {@link #defaultTimeoutSeconds}. 394 * <p> 395 * Call to apply the selected configs. 396 * 397 * @param configs Configs to apply against. 398 * @return StatusCode of the set command 399 */ 400 public StatusCode apply(CurrentLimitsConfigs configs) 401 { 402 return apply(configs, defaultTimeoutSeconds); 403 } 404 405 /** 406 * Applies the contents of the specified config to the device. 407 * <p> 408 * Call to apply the selected configs. 409 * 410 * @param configs Configs to apply against. 411 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 412 * @return StatusCode of the set command 413 */ 414 public StatusCode apply(CurrentLimitsConfigs configs, double timeoutSeconds) 415 { 416 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 417 } 418 419 420 /** 421 * Refreshes the values of the specified config group. 422 * <p> 423 * This will wait up to {@link #defaultTimeoutSeconds}. 424 * <p> 425 * Call to refresh the selected configs from the device. 426 * 427 * @param configs The configs to refresh 428 * @return StatusCode of refreshing the configs 429 */ 430 public StatusCode refresh(VoltageConfigs configs) 431 { 432 return refresh(configs, defaultTimeoutSeconds); 433 } 434 435 /** 436 * Refreshes the values of the specified config group. 437 * <p> 438 * Call to refresh the selected configs from the device. 439 * 440 * @param configs The configs to refresh 441 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 442 * @return StatusCode of refreshing the configs 443 */ 444 public StatusCode refresh(VoltageConfigs configs, double timeoutSeconds) 445 { 446 StringBuilder serializedString = new StringBuilder(); 447 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 448 if (err == StatusCode.OK) { 449 /* Only deserialize if we successfully got configs */ 450 configs.deserialize(serializedString.toString()); 451 } 452 return err; 453 } 454 455 /** 456 * Applies the contents of the specified config to the device. 457 * <p> 458 * This will wait up to {@link #defaultTimeoutSeconds}. 459 * <p> 460 * Call to apply the selected configs. 461 * 462 * @param configs Configs to apply against. 463 * @return StatusCode of the set command 464 */ 465 public StatusCode apply(VoltageConfigs configs) 466 { 467 return apply(configs, defaultTimeoutSeconds); 468 } 469 470 /** 471 * Applies the contents of the specified config to the device. 472 * <p> 473 * Call to apply the selected configs. 474 * 475 * @param configs Configs to apply against. 476 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 477 * @return StatusCode of the set command 478 */ 479 public StatusCode apply(VoltageConfigs configs, double timeoutSeconds) 480 { 481 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 482 } 483 484 485 /** 486 * Refreshes the values of the specified config group. 487 * <p> 488 * This will wait up to {@link #defaultTimeoutSeconds}. 489 * <p> 490 * Call to refresh the selected configs from the device. 491 * 492 * @param configs The configs to refresh 493 * @return StatusCode of refreshing the configs 494 */ 495 public StatusCode refresh(TorqueCurrentConfigs configs) 496 { 497 return refresh(configs, defaultTimeoutSeconds); 498 } 499 500 /** 501 * Refreshes the values of the specified config group. 502 * <p> 503 * Call to refresh the selected configs from the device. 504 * 505 * @param configs The configs to refresh 506 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 507 * @return StatusCode of refreshing the configs 508 */ 509 public StatusCode refresh(TorqueCurrentConfigs configs, double timeoutSeconds) 510 { 511 StringBuilder serializedString = new StringBuilder(); 512 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 513 if (err == StatusCode.OK) { 514 /* Only deserialize if we successfully got configs */ 515 configs.deserialize(serializedString.toString()); 516 } 517 return err; 518 } 519 520 /** 521 * Applies the contents of the specified config to the device. 522 * <p> 523 * This will wait up to {@link #defaultTimeoutSeconds}. 524 * <p> 525 * Call to apply the selected configs. 526 * 527 * @param configs Configs to apply against. 528 * @return StatusCode of the set command 529 */ 530 public StatusCode apply(TorqueCurrentConfigs configs) 531 { 532 return apply(configs, defaultTimeoutSeconds); 533 } 534 535 /** 536 * Applies the contents of the specified config to the device. 537 * <p> 538 * Call to apply the selected configs. 539 * 540 * @param configs Configs to apply against. 541 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 542 * @return StatusCode of the set command 543 */ 544 public StatusCode apply(TorqueCurrentConfigs configs, double timeoutSeconds) 545 { 546 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 547 } 548 549 550 /** 551 * Refreshes the values of the specified config group. 552 * <p> 553 * This will wait up to {@link #defaultTimeoutSeconds}. 554 * <p> 555 * Call to refresh the selected configs from the device. 556 * 557 * @param configs The configs to refresh 558 * @return StatusCode of refreshing the configs 559 */ 560 public StatusCode refresh(FeedbackConfigs configs) 561 { 562 return refresh(configs, defaultTimeoutSeconds); 563 } 564 565 /** 566 * Refreshes the values of the specified config group. 567 * <p> 568 * Call to refresh the selected configs from the device. 569 * 570 * @param configs The configs to refresh 571 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 572 * @return StatusCode of refreshing the configs 573 */ 574 public StatusCode refresh(FeedbackConfigs configs, double timeoutSeconds) 575 { 576 StringBuilder serializedString = new StringBuilder(); 577 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 578 if (err == StatusCode.OK) { 579 /* Only deserialize if we successfully got configs */ 580 configs.deserialize(serializedString.toString()); 581 } 582 return err; 583 } 584 585 /** 586 * Applies the contents of the specified config to the device. 587 * <p> 588 * This will wait up to {@link #defaultTimeoutSeconds}. 589 * <p> 590 * Call to apply the selected configs. 591 * 592 * @param configs Configs to apply against. 593 * @return StatusCode of the set command 594 */ 595 public StatusCode apply(FeedbackConfigs configs) 596 { 597 return apply(configs, defaultTimeoutSeconds); 598 } 599 600 /** 601 * Applies the contents of the specified config to the device. 602 * <p> 603 * Call to apply the selected configs. 604 * 605 * @param configs Configs to apply against. 606 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 607 * @return StatusCode of the set command 608 */ 609 public StatusCode apply(FeedbackConfigs configs, double timeoutSeconds) 610 { 611 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 612 } 613 614 615 /** 616 * Refreshes the values of the specified config group. 617 * <p> 618 * This will wait up to {@link #defaultTimeoutSeconds}. 619 * <p> 620 * Call to refresh the selected configs from the device. 621 * 622 * @param configs The configs to refresh 623 * @return StatusCode of refreshing the configs 624 */ 625 public StatusCode refresh(OpenLoopRampsConfigs configs) 626 { 627 return refresh(configs, defaultTimeoutSeconds); 628 } 629 630 /** 631 * Refreshes the values of the specified config group. 632 * <p> 633 * Call to refresh the selected configs from the device. 634 * 635 * @param configs The configs to refresh 636 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 637 * @return StatusCode of refreshing the configs 638 */ 639 public StatusCode refresh(OpenLoopRampsConfigs configs, double timeoutSeconds) 640 { 641 StringBuilder serializedString = new StringBuilder(); 642 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 643 if (err == StatusCode.OK) { 644 /* Only deserialize if we successfully got configs */ 645 configs.deserialize(serializedString.toString()); 646 } 647 return err; 648 } 649 650 /** 651 * Applies the contents of the specified config to the device. 652 * <p> 653 * This will wait up to {@link #defaultTimeoutSeconds}. 654 * <p> 655 * Call to apply the selected configs. 656 * 657 * @param configs Configs to apply against. 658 * @return StatusCode of the set command 659 */ 660 public StatusCode apply(OpenLoopRampsConfigs configs) 661 { 662 return apply(configs, defaultTimeoutSeconds); 663 } 664 665 /** 666 * Applies the contents of the specified config to the device. 667 * <p> 668 * Call to apply the selected configs. 669 * 670 * @param configs Configs to apply against. 671 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 672 * @return StatusCode of the set command 673 */ 674 public StatusCode apply(OpenLoopRampsConfigs configs, double timeoutSeconds) 675 { 676 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 677 } 678 679 680 /** 681 * Refreshes the values of the specified config group. 682 * <p> 683 * This will wait up to {@link #defaultTimeoutSeconds}. 684 * <p> 685 * Call to refresh the selected configs from the device. 686 * 687 * @param configs The configs to refresh 688 * @return StatusCode of refreshing the configs 689 */ 690 public StatusCode refresh(ClosedLoopRampsConfigs configs) 691 { 692 return refresh(configs, defaultTimeoutSeconds); 693 } 694 695 /** 696 * Refreshes the values of the specified config group. 697 * <p> 698 * Call to refresh the selected configs from the device. 699 * 700 * @param configs The configs to refresh 701 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 702 * @return StatusCode of refreshing the configs 703 */ 704 public StatusCode refresh(ClosedLoopRampsConfigs configs, double timeoutSeconds) 705 { 706 StringBuilder serializedString = new StringBuilder(); 707 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 708 if (err == StatusCode.OK) { 709 /* Only deserialize if we successfully got configs */ 710 configs.deserialize(serializedString.toString()); 711 } 712 return err; 713 } 714 715 /** 716 * Applies the contents of the specified config to the device. 717 * <p> 718 * This will wait up to {@link #defaultTimeoutSeconds}. 719 * <p> 720 * Call to apply the selected configs. 721 * 722 * @param configs Configs to apply against. 723 * @return StatusCode of the set command 724 */ 725 public StatusCode apply(ClosedLoopRampsConfigs configs) 726 { 727 return apply(configs, defaultTimeoutSeconds); 728 } 729 730 /** 731 * Applies the contents of the specified config to the device. 732 * <p> 733 * Call to apply the selected configs. 734 * 735 * @param configs Configs to apply against. 736 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 737 * @return StatusCode of the set command 738 */ 739 public StatusCode apply(ClosedLoopRampsConfigs configs, double timeoutSeconds) 740 { 741 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 742 } 743 744 745 /** 746 * Refreshes the values of the specified config group. 747 * <p> 748 * This will wait up to {@link #defaultTimeoutSeconds}. 749 * <p> 750 * Call to refresh the selected configs from the device. 751 * 752 * @param configs The configs to refresh 753 * @return StatusCode of refreshing the configs 754 */ 755 public StatusCode refresh(HardwareLimitSwitchConfigs configs) 756 { 757 return refresh(configs, defaultTimeoutSeconds); 758 } 759 760 /** 761 * Refreshes the values of the specified config group. 762 * <p> 763 * Call to refresh the selected configs from the device. 764 * 765 * @param configs The configs to refresh 766 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 767 * @return StatusCode of refreshing the configs 768 */ 769 public StatusCode refresh(HardwareLimitSwitchConfigs configs, double timeoutSeconds) 770 { 771 StringBuilder serializedString = new StringBuilder(); 772 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 773 if (err == StatusCode.OK) { 774 /* Only deserialize if we successfully got configs */ 775 configs.deserialize(serializedString.toString()); 776 } 777 return err; 778 } 779 780 /** 781 * Applies the contents of the specified config to the device. 782 * <p> 783 * This will wait up to {@link #defaultTimeoutSeconds}. 784 * <p> 785 * Call to apply the selected configs. 786 * 787 * @param configs Configs to apply against. 788 * @return StatusCode of the set command 789 */ 790 public StatusCode apply(HardwareLimitSwitchConfigs configs) 791 { 792 return apply(configs, defaultTimeoutSeconds); 793 } 794 795 /** 796 * Applies the contents of the specified config to the device. 797 * <p> 798 * Call to apply the selected configs. 799 * 800 * @param configs Configs to apply against. 801 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 802 * @return StatusCode of the set command 803 */ 804 public StatusCode apply(HardwareLimitSwitchConfigs configs, double timeoutSeconds) 805 { 806 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 807 } 808 809 810 /** 811 * Refreshes the values of the specified config group. 812 * <p> 813 * This will wait up to {@link #defaultTimeoutSeconds}. 814 * <p> 815 * Call to refresh the selected configs from the device. 816 * 817 * @param configs The configs to refresh 818 * @return StatusCode of refreshing the configs 819 */ 820 public StatusCode refresh(AudioConfigs configs) 821 { 822 return refresh(configs, defaultTimeoutSeconds); 823 } 824 825 /** 826 * Refreshes the values of the specified config group. 827 * <p> 828 * Call to refresh the selected configs from the device. 829 * 830 * @param configs The configs to refresh 831 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 832 * @return StatusCode of refreshing the configs 833 */ 834 public StatusCode refresh(AudioConfigs configs, double timeoutSeconds) 835 { 836 StringBuilder serializedString = new StringBuilder(); 837 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 838 if (err == StatusCode.OK) { 839 /* Only deserialize if we successfully got configs */ 840 configs.deserialize(serializedString.toString()); 841 } 842 return err; 843 } 844 845 /** 846 * Applies the contents of the specified config to the device. 847 * <p> 848 * This will wait up to {@link #defaultTimeoutSeconds}. 849 * <p> 850 * Call to apply the selected configs. 851 * 852 * @param configs Configs to apply against. 853 * @return StatusCode of the set command 854 */ 855 public StatusCode apply(AudioConfigs configs) 856 { 857 return apply(configs, defaultTimeoutSeconds); 858 } 859 860 /** 861 * Applies the contents of the specified config to the device. 862 * <p> 863 * Call to apply the selected configs. 864 * 865 * @param configs Configs to apply against. 866 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 867 * @return StatusCode of the set command 868 */ 869 public StatusCode apply(AudioConfigs configs, double timeoutSeconds) 870 { 871 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 872 } 873 874 875 /** 876 * Refreshes the values of the specified config group. 877 * <p> 878 * This will wait up to {@link #defaultTimeoutSeconds}. 879 * <p> 880 * Call to refresh the selected configs from the device. 881 * 882 * @param configs The configs to refresh 883 * @return StatusCode of refreshing the configs 884 */ 885 public StatusCode refresh(SoftwareLimitSwitchConfigs configs) 886 { 887 return refresh(configs, defaultTimeoutSeconds); 888 } 889 890 /** 891 * Refreshes the values of the specified config group. 892 * <p> 893 * Call to refresh the selected configs from the device. 894 * 895 * @param configs The configs to refresh 896 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 897 * @return StatusCode of refreshing the configs 898 */ 899 public StatusCode refresh(SoftwareLimitSwitchConfigs configs, double timeoutSeconds) 900 { 901 StringBuilder serializedString = new StringBuilder(); 902 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 903 if (err == StatusCode.OK) { 904 /* Only deserialize if we successfully got configs */ 905 configs.deserialize(serializedString.toString()); 906 } 907 return err; 908 } 909 910 /** 911 * Applies the contents of the specified config to the device. 912 * <p> 913 * This will wait up to {@link #defaultTimeoutSeconds}. 914 * <p> 915 * Call to apply the selected configs. 916 * 917 * @param configs Configs to apply against. 918 * @return StatusCode of the set command 919 */ 920 public StatusCode apply(SoftwareLimitSwitchConfigs configs) 921 { 922 return apply(configs, defaultTimeoutSeconds); 923 } 924 925 /** 926 * Applies the contents of the specified config to the device. 927 * <p> 928 * Call to apply the selected configs. 929 * 930 * @param configs Configs to apply against. 931 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 932 * @return StatusCode of the set command 933 */ 934 public StatusCode apply(SoftwareLimitSwitchConfigs configs, double timeoutSeconds) 935 { 936 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 937 } 938 939 940 /** 941 * Refreshes the values of the specified config group. 942 * <p> 943 * This will wait up to {@link #defaultTimeoutSeconds}. 944 * <p> 945 * Call to refresh the selected configs from the device. 946 * 947 * @param configs The configs to refresh 948 * @return StatusCode of refreshing the configs 949 */ 950 public StatusCode refresh(MotionMagicConfigs configs) 951 { 952 return refresh(configs, defaultTimeoutSeconds); 953 } 954 955 /** 956 * Refreshes the values of the specified config group. 957 * <p> 958 * Call to refresh the selected configs from the device. 959 * 960 * @param configs The configs to refresh 961 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 962 * @return StatusCode of refreshing the configs 963 */ 964 public StatusCode refresh(MotionMagicConfigs configs, double timeoutSeconds) 965 { 966 StringBuilder serializedString = new StringBuilder(); 967 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 968 if (err == StatusCode.OK) { 969 /* Only deserialize if we successfully got configs */ 970 configs.deserialize(serializedString.toString()); 971 } 972 return err; 973 } 974 975 /** 976 * Applies the contents of the specified config to the device. 977 * <p> 978 * This will wait up to {@link #defaultTimeoutSeconds}. 979 * <p> 980 * Call to apply the selected configs. 981 * 982 * @param configs Configs to apply against. 983 * @return StatusCode of the set command 984 */ 985 public StatusCode apply(MotionMagicConfigs configs) 986 { 987 return apply(configs, defaultTimeoutSeconds); 988 } 989 990 /** 991 * Applies the contents of the specified config to the device. 992 * <p> 993 * Call to apply the selected configs. 994 * 995 * @param configs Configs to apply against. 996 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 997 * @return StatusCode of the set command 998 */ 999 public StatusCode apply(MotionMagicConfigs configs, double timeoutSeconds) 1000 { 1001 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 1002 } 1003 1004 1005 /** 1006 * Refreshes the values of the specified config group. 1007 * <p> 1008 * This will wait up to {@link #defaultTimeoutSeconds}. 1009 * <p> 1010 * Call to refresh the selected configs from the device. 1011 * 1012 * @param configs The configs to refresh 1013 * @return StatusCode of refreshing the configs 1014 */ 1015 public StatusCode refresh(CustomParamsConfigs configs) 1016 { 1017 return refresh(configs, defaultTimeoutSeconds); 1018 } 1019 1020 /** 1021 * Refreshes the values of the specified config group. 1022 * <p> 1023 * Call to refresh the selected configs from the device. 1024 * 1025 * @param configs The configs to refresh 1026 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 1027 * @return StatusCode of refreshing the configs 1028 */ 1029 public StatusCode refresh(CustomParamsConfigs configs, double timeoutSeconds) 1030 { 1031 StringBuilder serializedString = new StringBuilder(); 1032 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 1033 if (err == StatusCode.OK) { 1034 /* Only deserialize if we successfully got configs */ 1035 configs.deserialize(serializedString.toString()); 1036 } 1037 return err; 1038 } 1039 1040 /** 1041 * Applies the contents of the specified config to the device. 1042 * <p> 1043 * This will wait up to {@link #defaultTimeoutSeconds}. 1044 * <p> 1045 * Call to apply the selected configs. 1046 * 1047 * @param configs Configs to apply against. 1048 * @return StatusCode of the set command 1049 */ 1050 public StatusCode apply(CustomParamsConfigs configs) 1051 { 1052 return apply(configs, defaultTimeoutSeconds); 1053 } 1054 1055 /** 1056 * Applies the contents of the specified config to the device. 1057 * <p> 1058 * Call to apply the selected configs. 1059 * 1060 * @param configs Configs to apply against. 1061 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 1062 * @return StatusCode of the set command 1063 */ 1064 public StatusCode apply(CustomParamsConfigs configs, double timeoutSeconds) 1065 { 1066 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 1067 } 1068 1069 1070 /** 1071 * Refreshes the values of the specified config group. 1072 * <p> 1073 * This will wait up to {@link #defaultTimeoutSeconds}. 1074 * <p> 1075 * Call to refresh the selected configs from the device. 1076 * 1077 * @param configs The configs to refresh 1078 * @return StatusCode of refreshing the configs 1079 */ 1080 public StatusCode refresh(ClosedLoopGeneralConfigs configs) 1081 { 1082 return refresh(configs, defaultTimeoutSeconds); 1083 } 1084 1085 /** 1086 * Refreshes the values of the specified config group. 1087 * <p> 1088 * Call to refresh the selected configs from the device. 1089 * 1090 * @param configs The configs to refresh 1091 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 1092 * @return StatusCode of refreshing the configs 1093 */ 1094 public StatusCode refresh(ClosedLoopGeneralConfigs configs, double timeoutSeconds) 1095 { 1096 StringBuilder serializedString = new StringBuilder(); 1097 StatusCode err = getConfigsPrivate(serializedString, timeoutSeconds); 1098 if (err == StatusCode.OK) { 1099 /* Only deserialize if we successfully got configs */ 1100 configs.deserialize(serializedString.toString()); 1101 } 1102 return err; 1103 } 1104 1105 /** 1106 * Applies the contents of the specified config to the device. 1107 * <p> 1108 * This will wait up to {@link #defaultTimeoutSeconds}. 1109 * <p> 1110 * Call to apply the selected configs. 1111 * 1112 * @param configs Configs to apply against. 1113 * @return StatusCode of the set command 1114 */ 1115 public StatusCode apply(ClosedLoopGeneralConfigs configs) 1116 { 1117 return apply(configs, defaultTimeoutSeconds); 1118 } 1119 1120 /** 1121 * Applies the contents of the specified config to the device. 1122 * <p> 1123 * Call to apply the selected configs. 1124 * 1125 * @param configs Configs to apply against. 1126 * @param timeoutSeconds Maximum amount of time to wait when performing configuration 1127 * @return StatusCode of the set command 1128 */ 1129 public StatusCode apply(ClosedLoopGeneralConfigs configs, double timeoutSeconds) 1130 { 1131 return setConfigsPrivate(configs.serialize(), timeoutSeconds, false, false); 1132 } 1133 1134 1135 /** 1136 * The position to set the rotor position to right now. 1137 * <p> 1138 * This will wait up to {@link #defaultTimeoutSeconds}. 1139 * <p> 1140 * This is available in the configurator in case the user wants 1141 * to initialize their device entirely without passing a device 1142 * reference down to the code that performs the initialization. 1143 * In this case, the user passes down the configurator object 1144 * and performs all the initialization code on the object. 1145 * 1146 * @param newValue Value to set to. 1147 * @return StatusCode of the set command 1148 */ 1149 public StatusCode setRotorPosition(double newValue) { 1150 return setRotorPosition(newValue, defaultTimeoutSeconds); 1151 } 1152 /** 1153 * The position to set the rotor position to right now. 1154 * <p> 1155 * This is available in the configurator in case the user wants 1156 * to initialize their device entirely without passing a device 1157 * reference down to the code that performs the initialization. 1158 * In this case, the user passes down the configurator object 1159 * and performs all the initialization code on the object. 1160 * 1161 * @param newValue Value to set to. 1162 * @param timeoutSeconds Maximum time to wait up to in seconds. 1163 * @return StatusCode of the set command 1164 */ 1165 public StatusCode setRotorPosition(double newValue, double timeoutSeconds) { 1166 String serialized = ConfigJNI.Serializedouble(1008, newValue); 1167 return setConfigsPrivate(serialized, timeoutSeconds, false, true); 1168 } 1169 1170 /** 1171 * Clear the sticky faults in the device. 1172 * <p> 1173 * This typically has no impact on the device functionality. Instead, 1174 * it just clears telemetry faults that are accessible via API and 1175 * Tuner Self-Test. 1176 * <p> 1177 * This will wait up to {@link #defaultTimeoutSeconds}. 1178 * <p> 1179 * This is available in the configurator in case the user wants 1180 * to initialize their device entirely without passing a device 1181 * reference down to the code that performs the initialization. 1182 * In this case, the user passes down the configurator object 1183 * and performs all the initialization code on the object. 1184 * @return StatusCode of the set command 1185 */ 1186 public StatusCode clearStickyFaults() { 1187 return clearStickyFaults(defaultTimeoutSeconds); 1188 } 1189 /** 1190 * Clear the sticky faults in the device. 1191 * <p> 1192 * This typically has no impact on the device functionality. Instead, 1193 * it just clears telemetry faults that are accessible via API and 1194 * Tuner Self-Test. 1195 * <p> 1196 * This is available in the configurator in case the user wants 1197 * to initialize their device entirely without passing a device 1198 * reference down to the code that performs the initialization. 1199 * In this case, the user passes down the configurator object 1200 * and performs all the initialization code on the object. 1201 * @param timeoutSeconds Maximum time to wait up to in seconds. 1202 * @return StatusCode of the set command 1203 */ 1204 public StatusCode clearStickyFaults(double timeoutSeconds) { 1205 String serialized = ConfigJNI.Serializedouble(1476, 0); 1206 return setConfigsPrivate(serialized, timeoutSeconds, false, true); 1207 } 1208}