diff --git a/frameworks/ets/taihe/author/src/ohos.vibrator.impl.cpp b/frameworks/ets/taihe/author/src/ohos.vibrator.impl.cpp index ebb2d563a93adbe8135703987da3154a245f6c6e..8d294e967aa697f3cd3bb7c9a8419c2db39dcbb8 100644 --- a/frameworks/ets/taihe/author/src/ohos.vibrator.impl.cpp +++ b/frameworks/ets/taihe/author/src/ohos.vibrator.impl.cpp @@ -86,7 +86,8 @@ static bool ParseVibratorCurvePoint(::taihe::array<::ohos::vibrator::VibratorCur { CALL_LOG_ENTER; point.time = pointsArray[index].time; - point.intensity = pointsArray[index].intensity.has_value() ? pointsArray[index].intensity.value() : 0; + point.intensity = + pointsArray[index].intensity.has_value() ? static_cast(pointsArray[index].intensity.value()) : 0; point.frequency = pointsArray[index].frequency.has_value() ? pointsArray[index].frequency.value() : 0; return true; } @@ -197,7 +198,7 @@ static void PrintVibratorPattern(::ohos::vibrator::VibratorPattern &vibratorPatt ::taihe::array<::ohos::vibrator::VibratorCurvePoint> point = vibratorPattern.events[i].points.value(); for (int32_t j = 0; j < static_cast(vibratorPattern.events[i].points.value().size()); ++j) { MISC_HILOGD("PrintVibratorPattern, time:%{public}d, intensity:%{public}d, frequency:%{public}d", - point[j].time, point[j].intensity.value(), point[j].frequency.value()); + point[j].time, static_cast(point[j].intensity.value()), point[j].frequency.value()); } } } @@ -218,7 +219,7 @@ static bool CheckVibratorCurvePoint(const ::ohos::vibrator::VibratorEvent &event if ((event.points.value()[j].intensity.value() < 0) || (event.points.value()[j].intensity.value() > CURVE_POINT_INTENSITY_MAX)) { MISC_HILOGE("intensity in points is out of range, intensity:%{public}d", - event.points.value()[j].intensity.value()); + static_cast(event.points.value()[j].intensity.value())); return false; } if ((event.points.value()[j].frequency.value() < CURVE_FREQUENCY_MIN) || diff --git a/frameworks/ets/taihe/idl/ohos.vibrator.taihe b/frameworks/ets/taihe/idl/ohos.vibrator.taihe index ebc91895bbd1cbf77614a9949e3fd24fa77d4ece..226df2bc2ff8f8d066bc36412f1c8ee7e6fa7b05 100644 --- a/frameworks/ets/taihe/idl/ohos.vibrator.taihe +++ b/frameworks/ets/taihe/idl/ohos.vibrator.taihe @@ -412,11 +412,11 @@ struct VibratorCurvePoint { /** * Gain in relative event vibration intensity * - * @type { Optional } + * @type { Optional } * @syscap SystemCapability.Sensors.MiscDevice * @since 18 */ - intensity: Optional; + intensity: Optional; /** * Changes in relative event vibration frequency * @@ -595,21 +595,21 @@ struct HapticFileDescriptor { * The offset into the file where the data to be read, in bytes. By default, * the offset is zero. * - * @type { Optional } + * @type { Optional } * @syscap SystemCapability.Sensors.MiscDevice * @since 10 */ - offset: Optional; + offset: Optional; /** * The length in bytes of the data to be read. By default, the length is the * rest of bytes in the file from the offset. * - * @type { Optional } + * @type { Optional } * @syscap SystemCapability.Sensors.MiscDevice * @since 10 */ - length: Optional; + length: Optional; } /**