IDODeviceVibrationRingtoneModel
Model for querying or setting device vibration and ringtone.
Fields
| Property | JSON Key | Type | Description |
|---|---|---|---|
operate |
operate |
Int | Query 1 / set 2 (set by the corresponding Cmds API) |
type |
type |
Int? | Sub-item mask bit0~2; optional for query, required for set; value 1~7 |
vibrationIntensity |
vibration_intensity |
Int? | Vibration intensity: 0 off / 1 weak / 2 medium / 3 strong; valid when type bit0 is set |
supportedVibrationIntensity |
supported_vibration_intensity |
List\ |
Query reply only: supported vibration intensity levels |
alarmVolume |
alarm_volume |
Int? | Alarm volume; valid when type bit1 is set |
callReminderVolume |
call_reminder_volume |
Int? | Call reminder volume; valid when type bit2 is set |
errCode |
err_code |
Int? | Query reply: 0 success |
retCode |
ret_code |
Int? | Set reply: 0 success |
Use the type mask in the reply to decide which sub-item fields are valid.
type mask
type selects sub-items from low bit to high bit; bits can be combined with bitwise OR. Valid bits are bit0~bit2; legal values are 1~7:
| Bit | Value | Meaning | Function table |
|---|---|---|---|
| bit0 | 1 (0x01) |
Vibration intensity | supportVibrationSetting |
| bit1 | 2 (0x02) |
Alarm volume | supportAlarmVolumeSetting |
| bit2 | 4 (0x04) |
Call reminder volume | supportCallReminderVolumeSetting |
| type | Sub-items | ||
|---|---|---|---|
1 |
Vibration intensity | ||
2 |
Alarm volume | ||
3 (`1\ |
2`) | Vibration intensity + alarm volume | |
4 |
Call reminder volume | ||
5 (`1\ |
4`) | Vibration intensity + call reminder volume | |
6 (`2\ |
4`) | Alarm volume + call reminder volume | |
7 (`1\ |
2\ | 4`) | All three |
Example JSON
Query reply:
{
"operate": 1,
"err_code": 0,
"type": 3,
"vibration_intensity": 2,
"supported_vibration_intensity": [1, 2, 3],
"alarm_volume": 5
}
Set reply:
{
"operate": 2,
"ret_code": 0
}