@@ -78,7 +78,7 @@ This JSON file contains two attributes: **MetaData** and **Channels**.
...
@@ -78,7 +78,7 @@ This JSON file contains two attributes: **MetaData** and **Channels**.
-**Channels** provides information about the vibration channel. It is a JSON array that holds information about each channel. It contains two attributes: **Parameters** and **Pattern**.
-**Channels** provides information about the vibration channel. It is a JSON array that holds information about each channel. It contains two attributes: **Parameters** and **Pattern**.
-**Parameters** provides parameters related to the channel. Under it, **Index** indicates the channel ID. The value is fixed at **1** for a single channel. This parameter is mandatory.
-**Parameters** provides parameters related to the channel. Under it, **Index** indicates the channel ID. The value is fixed at **1** for a single channel. This parameter is mandatory.
-**Pattern** indicates the vibration sequence. It is a JSON array. Under it, **Event** indicates a vibration event, which can be either of the following types:
-**Pattern** indicates the vibration sequence. It is a JSON array. Under it, **Event** indicates a vibration event, which can be either of the following types:
-**transient**: short vibration
-**transient**: short vibration
-**continuous**: long vibration
-**continuous**: long vibration
The table below describes the parameters under **Event**.
The table below describes the parameters under **Event**.
...
@@ -105,8 +105,9 @@ The following requirements must be met:
...
@@ -105,8 +105,9 @@ The following requirements must be met:
2. Start vibration with the specified effect and attribute.
2. Start vibration with the specified effect and attribute.
```js
```ts
importvibratorfrom'@ohos.vibrator';
importvibratorfrom'@ohos.vibrator';
try{
try{
vibrator.startVibration({// To use startVibration, you must configure the ohos.permission.VIBRATE permission.
vibrator.startVibration({// To use startVibration, you must configure the ohos.permission.VIBRATE permission.
type:'time',
type:'time',
...
@@ -116,37 +117,38 @@ The following requirements must be met:
...
@@ -116,37 +117,38 @@ The following requirements must be met: