1/* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"), 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit MechanicKit 19 * @arkts 1.1&1.2 20 */ 21 22import type { Callback } from './@ohos.base'; 23 24/** 25 * Provides capabilities for controlling and interacting with mechanical devices connected to this device. 26 * The capabilities cover connection management, control, and monitoring. 27 * 28 * @namespace mechanicManager 29 * @syscap SystemCapability.Mechanic.Core 30 * @since 20 31 */ 32 33declare namespace mechanicManager { 34 35 /** 36 * Subscribes to device attachment state change events. 37 * @param { 'attachStateChange' } type Event type. 38 * @param { Callback<AttachStateChangeInfo> } callback Callback used to return the state change. 39 * @throws { BusinessError } 33300001 - Service exception. 40 * @syscap SystemCapability.Mechanic.Core 41 * @since 20 42 */ 43 function on(type: 'attachStateChange', callback: Callback<AttachStateChangeInfo>): void; 44 45 /** 46 * Unsubscribes from device attachment state change events. 47 * @param { 'attachStateChange' } type Event type. 48 * @param { Callback<AttachStateChangeInfo> } [callback] Callback used to return the state change. 49 * @throws { BusinessError } 33300001 - Service exception. 50 * @syscap SystemCapability.Mechanic.Core 51 * @since 20 52 */ 53 function off(type: 'attachStateChange', callback?: Callback<AttachStateChangeInfo>): void; 54 55 /** 56 * Obtain the list of connected mechanical devices. 57 * @returns { MechInfo[] } List of connected mechanical devices. 58 * @throws { BusinessError } 33300001 - Service exception. 59 * @syscap SystemCapability.Mechanic.Core 60 * @since 20 61 */ 62 function getAttachedMechDevices(): MechInfo[]; 63 64 /** 65 * Sets a user operation. 66 * @permission ohos.permission.CONNECT_MECHANIC_HARDWARE 67 * @param { Operation } operation Operation type. 68 * @param { string } mac MAC address. 69 * @param { string } params Operation parameters. 70 * @throws { BusinessError } 201 - Permission denied. 71 * @throws { BusinessError } 202 - Not system application. 72 * @throws { BusinessError } 33300001 - Service exception. 73 * @syscap SystemCapability.Mechanic.Core 74 * @systemapi 75 * @since 20 76 */ 77 function setUserOperation(operation: Operation, mac: string, params: string): void; 78 79 /** 80 * Enables or disables camera tracking. 81 * @param { boolean } isEnabled Whether to enable camera tracking. 82 * @throws { BusinessError } 33300001 - Service exception. 83 * @throws { BusinessError } 33300002 - Device not connected. 84 * @throws { BusinessError } 33300003 - Feature not supported. 85 * @syscap SystemCapability.Mechanic.Core 86 * @since 20 87 */ 88 89 function setCameraTrackingEnabled(isEnabled: boolean): void; 90 91 /** 92 * Checks whether camera tracking is enabled for this mechanical device. 93 * @returns { boolean } Enabled status. The value true means that camera tracking is enabled, and false means 94 * the opposite. 95 * @throws { BusinessError } 33300001 - Service exception. 96 * @throws { BusinessError } 33300002 - Device not connected. 97 * @syscap SystemCapability.Mechanic.Core 98 * @since 20 99 */ 100 101 function getCameraTrackingEnabled(): boolean; 102 103 /** 104 * Subscribes to tracking events. 105 * @param { 'trackingStateChange' } type Event type. 106 * @param { Callback<TrackingEventInfo> } callback Callback used to return the tracking event information. 107 * @throws { BusinessError } 33300001 - Service exception. 108 * @syscap SystemCapability.Mechanic.Core 109 * @since 20 110 */ 111 function on(type: 'trackingStateChange', callback: Callback<TrackingEventInfo>): void; 112 113 /** 114 * Unsubscribes from tracking events. 115 * @param { 'trackingStateChange' } type Event type. 116 * @param { Callback<TrackingEventInfo> } [callback] Callback used to return the tracking event information. 117 * @throws { BusinessError } 33300001 - Service exception. 118 * @syscap SystemCapability.Mechanic.Core 119 * @since 20 120 */ 121 function off(type: 'trackingStateChange', callback?: Callback<TrackingEventInfo>): void; 122 123 /** 124 * Sets the camera tracking layout for this mechanical device. 125 * @param { CameraTrackingLayout } trackingLayout Camera tracking layout. 126 * @throws { BusinessError } 202 - Not system application. 127 * @throws { BusinessError } 33300001 - Service exception. 128 * @throws { BusinessError } 33300002 - Device not connected. 129 * @throws { BusinessError } 33300003 - Feature not supported. 130 * @syscap SystemCapability.Mechanic.Core 131 * @systemapi 132 * @since 20 133 */ 134 135 function setCameraTrackingLayout(trackingLayout: CameraTrackingLayout): void; 136 137 /** 138 * Obtains the camera tracking layout of this mechanical device. 139 * @returns { CameraTrackingLayout } Camera tracking layout obtained. 140 * @throws { BusinessError } 33300001 - Service exception. 141 * @throws { BusinessError } 33300002 - Device not connected. 142 * @syscap SystemCapability.Mechanic.Core 143 * @since 20 144 */ 145 function getCameraTrackingLayout(): CameraTrackingLayout; 146 147 /** 148 * Rotates a mechanical device to the relative angles. 149 * @param { number } mechId ID of the mechanical device. 150 * @param { RotationAngles } angles Relative angles. 151 * @param { number } duration Rotation duration. Unit: millisecond. 152 * @returns { Promise<Result> } Promise that return the execution result. 153 * @throws { BusinessError } 202 - Not system application. 154 * @throws { BusinessError } 33300001 - Service exception. 155 * @throws { BusinessError } 33300002 - Device not connected. 156 * @syscap SystemCapability.Mechanic.Core 157 * @systemapi 158 * @since 20 159 */ 160 161 function rotate(mechId: number, angles: RotationAngles, duration: number): Promise<Result>; 162 163 /** 164 * Rotates a mechanical device to the absolute angles. 165 * @param { number } mechId ID of the mechanical device. 166 * @param { EulerAngles } angles Absolute angles. 167 * @param { number } duration Rotation duration. Unit: millisecond. 168 * @returns { Promise<Result> } Promise that return the execution result. 169 * @throws { BusinessError } 202 - Not system application. 170 * @throws { BusinessError } 33300001 - Service exception. 171 * @throws { BusinessError } 33300002 - Device not connected. 172 * @syscap SystemCapability.Mechanic.Core 173 * @systemapi 174 * @since 20 175 */ 176 177 function rotateToEulerAngles(mechId: number, angles: EulerAngles, duration: number): Promise<Result>; 178 179 /** 180 * Obtains the maximum continuous rotation duration of a mechanical device. 181 * 182 * @param { number } mechId ID of the mechanical device. 183 * @returns { number } Maximum rotation duration. Unit: millisecond. 184 * @throws { BusinessError } 202 - Not system application. 185 * @throws { BusinessError } 33300001 - Service exception. 186 * @throws { BusinessError } 33300002 - Device not connected. 187 * @syscap SystemCapability.Mechanic.Core 188 * @systemapi 189 * @since 20 190 */ 191 function getMaxRotationTime(mechId: number): number; 192 193 /** 194 * Obtains the maximum rotation speed of a mechanical device. 195 * 196 * @param { number } mechId ID of the mechanical device. 197 * @returns { RotationSpeed } Maximum speed. Only the absolute value of the speed is returned. 198 * @throws { BusinessError } 202 - Not system application. 199 * @throws { BusinessError } 33300001 - Service exception. 200 * @throws { BusinessError } 33300002 - Device not connected. 201 * @syscap SystemCapability.Mechanic.Core 202 * @systemapi 203 * @since 20 204 */ 205 function getMaxRotationSpeed(mechId: number): RotationSpeed; 206 207 /** 208 * Rotates a mechanical device at the specified speed. 209 * @param { number } mechId ID of the mechanical device. 210 * @param { RotationSpeed } speed Rotation speed. 211 * @param { number } duration Rotation duration. Unit: millisecond. 212 * @returns { Promise<Result> } Promise that return the execution result. 213 * @throws { BusinessError } 202 - Not system application. 214 * @throws { BusinessError } 33300001 - Service exception. 215 * @throws { BusinessError } 33300002 - Device not connected. 216 * @syscap SystemCapability.Mechanic.Core 217 * @systemapi 218 * @since 20 219 */ 220 function rotateBySpeed(mechId: number, speed: RotationSpeed, duration: number): Promise<Result>; 221 222 /** 223 * Stops a mechanical device from moving. 224 * @param { number } mechId ID of the mechanical device. 225 * @returns { Promise<void> } Promise that returns no value. 226 * @throws { BusinessError } 202 - Not system application. 227 * @throws { BusinessError } 33300001 - Service exception. 228 * @throws { BusinessError } 33300002 - Device not connected. 229 * @syscap SystemCapability.Mechanic.Core 230 * @systemapi 231 * @since 20 232 */ 233 function stopMoving(mechId: number): Promise<void>; 234 235 /** 236 * Obtains the current angles of a mechanical device. 237 * @param { number } mechId ID of the mechanical device. 238 * @returns { EulerAngles } Rotation angles. 239 * @throws { BusinessError } 202 - Not system application. 240 * @throws { BusinessError } 33300001 - Service exception. 241 * @throws { BusinessError } 33300002 - Device not connected. 242 * @syscap SystemCapability.Mechanic.Core 243 * @systemapi 244 * @since 20 245 */ 246 247 function getCurrentAngles(mechId: number): EulerAngles; 248 249 /** 250 * Obtains the maximum rotation angles relative to the reference point for the specified mechanical device. 251 * 252 * @param { number } mechId ID of the mechanical device. 253 * @returns { RotationLimits } Maximum rotation angles. 254 * @throws { BusinessError } 202 - Not system application. 255 * @throws { BusinessError } 33300001 - Service exception. 256 * @throws { BusinessError } 33300002 - Device not connected. 257 * @syscap SystemCapability.Mechanic.Core 258 * @systemapi 259 * @since 20 260 */ 261 262 function getRotationLimits(mechId: number): RotationLimits; 263 264 /** 265 * Obtains the status of the rotation axes. 266 * @param { number } mechId ID of the mechanical device. 267 * @returns { RotationAxesStatus } Rotation axis status. 268 * @throws { BusinessError } 202 - Not system application. 269 * @throws { BusinessError } 33300001 - Service exception. 270 * @throws { BusinessError } 33300002 - Device not connected. 271 * @syscap SystemCapability.Mechanic.Core 272 * @systemapi 273 * @since 20 274 */ 275 function getRotationAxesStatus(mechId: number): RotationAxesStatus; 276 277 278 /** 279 * Register a listener for axis state changes. 280 * The status of the rotation axis changes dynamically, which needs to be monitored. 281 * 282 * @param { 'rotationAxesStatusChange' } type - Event type. 283 * @param { Callback<RotationAxesStateChangeInfo> } callback - Rotate axis state changes callback. 284 * @throws { BusinessError } 202 - Not system application. 285 * @throws { BusinessError } 33300001 - Service exception. 286 * @syscap SystemCapability.Mechanic.Core 287 * @systemapi 288 * @since 20 289 */ 290 function on(type: 'rotationAxesStatusChange', callback: Callback<RotationAxesStateChangeInfo>): void; 291 292 /** 293 * Unregister a listener for axis state changes. 294 * 295 * @param { 'rotationAxesStatusChange' } type - Event type. 296 * @param { Callback<RotationAxesStateChangeInfo> } [callback] - Rotate axis state changes callback. 297 * @throws { BusinessError } 202 - Not system application. 298 * @throws { BusinessError } 33300001 - Service exception. 299 * @syscap SystemCapability.Mechanic.Core 300 * @systemapi 301 * @since 20 302 */ 303 function off(type: 'rotationAxesStatusChange', callback?: Callback<RotationAxesStateChangeInfo>): void; 304 305 /** 306 * Mechanical device information. 307 * @typedef MechInfo 308 * @syscap SystemCapability.Mechanic.Core 309 * @since 20 310 */ 311 export interface MechInfo { 312 /** 313 * ID of the mechanical device. 314 * @type { number } 315 * @syscap SystemCapability.Mechanic.Core 316 * @since 20 317 */ 318 mechId: number; 319 320 321 /** 322 * Type of the mechanical device. 323 * @type { MechDeviceType } 324 * @syscap SystemCapability.Mechanic.Core 325 * @since 20 326 */ 327 mechDeviceType: MechDeviceType; 328 329 /** 330 * Name of the mechanical device. 331 * @type { string } 332 * @syscap SystemCapability.Mechanic.Core 333 * @since 20 334 */ 335 mechName: string; 336 } 337 338 339 /** 340 * The rotion angles, relative to the current position. 341 * @typedef RotationAngles 342 * @syscap SystemCapability.Mechanic.Core 343 * @systemapi 344 * @since 20 345 */ 346 export interface RotationAngles { 347 /** 348 * Yaw angle, ranging from -2*Math.PI to 2*Math.PI, measured in radians. 349 * @type { ?number } 350 * @syscap SystemCapability.Mechanic.Core 351 * @systemapi 352 * @since 20 353 */ 354 355 yaw?: number; 356 357 /** 358 * Roll angle, ranging from -2*Math.PI to 2*Math.PI, measured in radians. 359 * @type { ?number } 360 * @syscap SystemCapability.Mechanic.Core 361 * @systemapi 362 * @since 20 363 */ 364 365 roll?: number; 366 367 /** 368 * Pitch angle, ranging from -2*Math.PI to 2*Math.PI, measured in radians. 369 * @type { ?number } 370 * @syscap SystemCapability.Mechanic.Core 371 * @systemapi 372 * @since 20 373 */ 374 375 pitch?: number; 376 } 377 378 /** 379 * Absolute euler angles relative to the home position. 380 * 381 * @typedef EulerAngles 382 * @syscap SystemCapability.Mechanic.Core 383 * @systemapi 384 * @since 20 385 */ 386 export interface EulerAngles { 387 /** 388 * Yaw angle, ranging from -Math.PI to Math.PI, measured in radians. 389 * @type { ?number } 390 * @syscap SystemCapability.Mechanic.Core 391 * @systemapi 392 * @since 20 393 */ 394 395 yaw?: number; 396 397 /** 398 * Roll angle, ranging from -Math.PI to Math.PI, measured in radians. 399 * @type { ?number } 400 * @syscap SystemCapability.Mechanic.Core 401 * @systemapi 402 * @since 20 403 */ 404 405 roll?: number; 406 407 /** 408 * Pitch angle, ranging from -Math.PI to Math.PI, measured in radians. 409 * @type { ?number } 410 * @syscap SystemCapability.Mechanic.Core 411 * @systemapi 412 * @since 20 413 */ 414 415 pitch?: number; 416 } 417 418 /** 419 * Rotational speed. A negative value indicates a clockwise rotation, and a positive value indicates a 420 * counterclockwise rotation. 421 * @typedef RotationSpeed 422 * @syscap SystemCapability.Mechanic.Core 423 * @systemapi 424 * @since 20 425 */ 426 427 export interface RotationSpeed { 428 /** 429 * Yaw speed, measured in radians per second. 430 * @type { ?number } 431 * @syscap SystemCapability.Mechanic.Core 432 * @systemapi 433 * @since 20 434 */ 435 436 yawSpeed?: number; 437 438 /** 439 * Roll speed, measured in radians per second. 440 * @type { ?number } 441 * @syscap SystemCapability.Mechanic.Core 442 * @systemapi 443 * @since 20 444 */ 445 446 rollSpeed?: number; 447 448 /** 449 * Pitch speed, measured in radians per second. 450 * @type { ?number } 451 * @syscap SystemCapability.Mechanic.Core 452 * @systemapi 453 * @since 20 454 */ 455 456 pitchSpeed?: number; 457 } 458 459 460 /** 461 * Rotation angle limits relative to the reference point. 462 * @typedef RotationLimits 463 * @syscap SystemCapability.Mechanic.Core 464 * @systemapi 465 * @since 20 466 */ 467 468 export interface RotationLimits { 469 /** 470 * Maximum yaw rotation angles in the negative direction, ranging from -2*Math.PI to 0, measured in radians. 471 * If the value is less than or equal to -2*Math.PI, there is no restriction. 472 * @type { number } 473 * @syscap SystemCapability.Mechanic.Core 474 * @systemapi 475 * @since 20 476 */ 477 negativeYawMax: number; 478 479 /** 480 * Maximum yaw rotation angles in the positive direction, ranging from 0 to 2*Math.PI, measured in radians. 481 * If the value is greater than or equal to 2*Math.PI, there is no restriction. 482 * @type { number } 483 * @syscap SystemCapability.Mechanic.Core 484 * @systemapi 485 * @since 20 486 */ 487 positiveYawMax: number; 488 489 /** 490 * Maximum roll rotation angles in the negative direction, ranging from -2*Math.PI to 0, measured in radians. 491 * If the value is less than or equal to -2*Math.PI, there is no restriction. 492 * @type { number } 493 * @syscap SystemCapability.Mechanic.Core 494 * @systemapi 495 * @since 20 496 */ 497 negativeRollMax: number; 498 499 /** 500 * Maximum roll rotation angles in the positive direction, ranging from 0 to 2*Math.PI, measured in radians. 501 * If the value is greater than or equal to 2*Math.PI, there is no restriction. 502 * @type { number } 503 * @syscap SystemCapability.Mechanic.Core 504 * @systemapi 505 * @since 20 506 */ 507 positiveRollMax: number; 508 509 /** 510 * Maximum pitch rotation angles in the negative direction, ranging from -2*Math.PI to 0, measured in radians. 511 * If the value is less than or equal to -2*Math.PI, there is no restriction. 512 * @type { number } 513 * @syscap SystemCapability.Mechanic.Core 514 * @systemapi 515 * @since 20 516 */ 517 negativePitchMax: number; 518 519 /** 520 * Maximum pitch rotation angles in the positive direction, ranging from 0 to 2*Math.PI, measured in radians. 521 * If the value is greater than or equal to 2*Math.PI, there is no restriction. 522 * @type { number } 523 * @syscap SystemCapability.Mechanic.Core 524 * @systemapi 525 * @since 20 526 */ 527 positivePitchMax: number; 528 } 529 530 /** 531 * Rotation axes status 532 * 533 * @typedef RotationAxesStatus 534 * @syscap SystemCapability.Mechanic.Core 535 * @systemapi 536 * @since 20 537 */ 538 export interface RotationAxesStatus { 539 /** 540 * Whether the yaw axis is enabled. 541 * @type { boolean } 542 * @syscap SystemCapability.Mechanic.Core 543 * @systemapi 544 * @since 20 545 */ 546 yawEnabled: boolean; 547 548 /** 549 * Whether the roll axis is enabled. 550 * @type { boolean } 551 * @syscap SystemCapability.Mechanic.Core 552 * @systemapi 553 * @since 20 554 */ 555 rollEnabled: boolean; 556 557 /** 558 * Whether the pitch axis is enabled. 559 * @type { boolean } 560 * @syscap SystemCapability.Mechanic.Core 561 * @systemapi 562 * @since 20 563 */ 564 pitchEnabled: boolean; 565 566 /** 567 * Whether the yaw axis is limited. 568 * @type { ?RotationAxisLimited } RotationAxisLimited 569 * @syscap SystemCapability.Mechanic.Core 570 * @systemapi 571 * @since 20 572 */ 573 yawLimited?: RotationAxisLimited; 574 575 /** 576 * Whether the roll axis is limited. 577 * @type { ?RotationAxisLimited } 578 * @syscap SystemCapability.Mechanic.Core 579 * @systemapi 580 * @since 20 581 */ 582 rollLimited?: RotationAxisLimited; 583 584 /** 585 * Whether the pitch axis is limited. 586 * @type { ?RotationAxisLimited } 587 * @syscap SystemCapability.Mechanic.Core 588 * @systemapi 589 * @since 20 590 */ 591 pitchLimited?: RotationAxisLimited; 592 } 593 594 /** 595 * Enumerates the rotation axis limit states. 596 * @enum { number } 597 * @syscap SystemCapability.Mechanic.Core 598 * @systemapi 599 * @since 20 600 */ 601 export enum RotationAxisLimited { 602 /** 603 * Not limited. 604 * @syscap SystemCapability.Mechanic.Core 605 * @systemapi 606 * @since 20 607 */ 608 NOT_LIMITED = 0, 609 610 /** 611 * Negative limited. 612 * @syscap SystemCapability.Mechanic.Core 613 * @systemapi 614 * @since 20 615 */ 616 NEGATIVE_LIMITED = 1, 617 618 /** 619 * Positive limited. 620 * @syscap SystemCapability.Mechanic.Core 621 * @systemapi 622 * @since 20 623 */ 624 POSITIVE_LIMITED = 2, 625 } 626 627 /** 628 * Rotation axes state change information. 629 * @typedef RotationAxesStateChangeInfo 630 * @syscap SystemCapability.Mechanic.Core 631 * @systemapi 632 * @since 20 633 */ 634 export interface RotationAxesStateChangeInfo { 635 /** 636 * ID of the mechanical device. 637 * @type { number } 638 * @syscap SystemCapability.Mechanic.Core 639 * @systemapi 640 * @since 20 641 */ 642 mechId: number; 643 644 /** 645 * Rotate axis status. 646 * @type { RotationAxesStatus } 647 * @syscap SystemCapability.Mechanic.Core 648 * @systemapi 649 * @since 20 650 */ 651 status: RotationAxesStatus, 652 } 653 654 /** 655 * Tracking event callback info. 656 * 657 * @typedef TrackingEventInfo 658 * @syscap SystemCapability.Mechanic.Core 659 * @since 20 660 */ 661 export interface TrackingEventInfo { 662 /** 663 * Tracking event. 664 * @type { TrackingEvent } Tracking event. 665 * @syscap SystemCapability.Mechanic.Core 666 * @since 20 667 */ 668 event: TrackingEvent; 669 } 670 671 /** 672 * Callback information about the device attachment state change. 673 * @typedef AttachStateChangeInfo 674 * @syscap SystemCapability.Mechanic.Core 675 * @since 20 676 */ 677 export interface AttachStateChangeInfo { 678 679 /** 680 * Device attachment state. 681 * @type { AttachState } 682 * @syscap SystemCapability.Mechanic.Core 683 * @since 20 684 */ 685 state: AttachState; 686 687 /** 688 * Mechanical device information. 689 * @type { MechInfo } 690 * @syscap SystemCapability.Mechanic.Core 691 * @since 20 692 */ 693 mechInfo: MechInfo, 694 } 695 696 /** 697 * Enumerates the user operations. 698 * @enum { number } 699 * @syscap SystemCapability.Mechanic.Core 700 * @systemapi 701 * @since 20 702 */ 703 export enum Operation { 704 /** 705 * Connection operation. 706 * @syscap SystemCapability.Mechanic.Core 707 * @systemapi 708 * @since 20 709 */ 710 CONNECT = 0, 711 712 /** 713 * Disconnection operation. 714 * @syscap SystemCapability.Mechanic.Core 715 * @systemapi 716 * @since 20 717 */ 718 DISCONNECT = 1 719 } 720 721 /** 722 * Enumerates the tracking events. 723 * @enum { number } 724 * @syscap SystemCapability.Mechanic.Core 725 * @since 20 726 */ 727 728 export enum TrackingEvent { 729 /** 730 * Camera tracking enabled by user. 731 * @syscap SystemCapability.Mechanic.Core 732 * @since 20 733 */ 734 CAMERA_TRACKING_USER_ENABLED = 0, 735 736 /** 737 * Camera tracking disabled by user. 738 * @syscap SystemCapability.Mechanic.Core 739 * @since 20 740 */ 741 CAMERA_TRACKING_USER_DISABLED = 1, 742 743 /** 744 * Camera tracking layout changed. You can call getCameraTrackingLayout to obtain the new layout. 745 * @syscap SystemCapability.Mechanic.Core 746 * @since 20 747 */ 748 CAMERA_TRACKING_LAYOUT_CHANGED = 2, 749 } 750 751 /** 752 * Rotation execution results. 753 * 754 * @enum { number } 755 * @syscap SystemCapability.Mechanic.Core 756 * @systemapi 757 * @since 20 758 */ 759 export enum Result { 760 /** 761 * Rotation completed. 762 * @syscap SystemCapability.Mechanic.Core 763 * @systemapi 764 * @since 20 765 */ 766 COMPLETED = 0, 767 768 /** 769 * Rotation was interrupted. 770 * @syscap SystemCapability.Mechanic.Core 771 * @systemapi 772 * @since 20 773 */ 774 INTERRUPTED = 1, 775 776 /** 777 * Device reached limitation. 778 * @syscap SystemCapability.Mechanic.Core 779 * @systemapi 780 * @since 20 781 */ 782 LIMITED = 2, 783 784 /** 785 * Rotation time out. 786 * @syscap SystemCapability.Mechanic.Core 787 * @systemapi 788 * @since 20 789 */ 790 TIMEOUT = 3, 791 792 /** 793 * Rotation failed due to system error. 794 * @syscap SystemCapability.Mechanic.Core 795 * @systemapi 796 * @since 20 797 */ 798 SYSTEM_ERROR = 100 799 } 800 801 /** 802 * Enumerates the mechanical device types. 803 * @enum { number } 804 * @syscap SystemCapability.Mechanic.Core 805 * @since 20 806 */ 807 808 export enum MechDeviceType { 809 /** 810 * Gimbal device. 811 * @syscap SystemCapability.Mechanic.Core 812 * @since 20 813 */ 814 815 GIMBAL_DEVICE = 0 816 } 817 818 /** 819 * Device attach states. 820 * 821 * @enum { number } 822 * @syscap SystemCapability.Mechanic.Core 823 * @since 20 824 */ 825 export enum AttachState { 826 827 /** 828 * Device attached. 829 * @syscap SystemCapability.Mechanic.Core 830 * @since 20 831 */ 832 ATTACHED = 0, 833 834 /** 835 * Device detached. 836 * @syscap SystemCapability.Mechanic.Core 837 * @since 20 838 */ 839 DETACHED = 1 840 } 841 842 /** 843 * Enumerates the camera tracking layouts. 844 * @enum { number } 845 * @syscap SystemCapability.Mechanic.Core 846 * @since 20 847 */ 848 export enum CameraTrackingLayout { 849 /** 850 * Default layout. 851 * @syscap SystemCapability.Mechanic.Core 852 * @since 20 853 */ 854 DEFAULT = 0, 855 856 /** 857 * Left-side layout. 858 * @syscap SystemCapability.Mechanic.Core 859 * @since 20 860 */ 861 LEFT = 1, 862 863 /** 864 * Middle layout. 865 * @syscap SystemCapability.Mechanic.Core 866 * @since 20 867 */ 868 MIDDLE = 2, 869 870 /** 871 * Right-side layout. 872 * @syscap SystemCapability.Mechanic.Core 873 * @since 20 874 */ 875 RIGHT = 3 876 } 877 878} 879 880export default mechanicManager;