Last Updated on : 2023-03-09 08:17:43
Creates an entity object of the message manager ITYCameraMessage
.
API description
ITYCameraMessage createCameraMessage();
Example
private ITYCameraMessage mTyCameraMessage;
ITuyaIPCMsg message = TuyaIPCSdk.getMessage();
if (message != null) {
cameraMessage = message.createCameraMessage();
}
Returns the date on which alerts are generated and displays the alert calendar.
API description
void queryMotionDaysByMonth(String devId, int year, int month, ITuyaResultCallback<List<String>> callback);
Parameters
Parameter | Description |
---|---|
devId | The device ID. |
year | The year in which alerts were generated. |
month | The month in which alerts were generated. |
callback | The callback. |
Example
mTyCameraMessage.queryMotionDaysByMonth(mDeviceBean.getDevId(), year, month, new ITuyaResultCallback<List<String>>() {
@Override
public void onSuccess(List<String> result) {
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
Detection alerts are classified into multiple types based on trigger methods. Certain types belong to a specific category. The IPC SDK returns a list of alerts by default category to support queries of alerts based on categories.
API description
void queryAlarmDetectionClassify(String devId, ITuyaResultCallback<List<CameraMessageClassifyBean>> callback);
Parameters
Parameter | Description |
---|---|
devId | The device ID. |
callback | The callback. |
Example
mTyCameraMessage.queryAlarmDetectionClassify(devId, new ITuyaResultCallback<List<CameraMessageClassifyBean>>() {
@Override
public void onSuccess(List<CameraMessageClassifyBean> result) {
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
Data model of CameraMessageClassifyBean
Parameter | Description |
---|---|
describe | The description of an alert. |
msgCode | An array of alert types. An alert type represents a trigger method of alerts. It is indicated by the msgCode attribute of the alert data model. |
Description of msgCode
Type | Description |
---|---|
ipc_motion | Motion detection |
ipc_doorbell | Doorbell call |
ipc_dev_link | Device linkage |
ipc_passby | Someone passes by |
ipc_linger | Someone lingers |
ipc_leave_msg | Leave messages on doorbell |
ipc_connected | Doorbell answered |
ipc_unconnected | Doorbell missed |
ipc_refuse | Doorbell rejected |
ipc_human | Human shape detection |
ipc_cat | Pet detection |
ipc_car | Vehicle detection |
ipc_baby_cry | Baby cry |
ipc_bang | Abnormal sound |
ipc_antibreak | Tamper alarm |
ipc_low_battery | Low battery alert |
The types of alerts that can be triggered vary depending on device capabilities. Alert categories and alert types are distinguished in the following ways:
ipc_passby
, ipc_linger
, and ipc_motion
can belong to the motion detection category.API description
void getAlarmDetectionMessageList(String devId, int startTime, int endTime, String[] msgCodes, int offset, int limit, ITuyaResultCallback<List<CameraMessageBean>> callback);
Parameters
Parameter | Description |
---|---|
devId | The device ID. |
startTime | The start timestamp. Unit: seconds. |
endTime | The end timestamp. Unit: seconds. |
msgCodes | The array of alert types.
|
offset | The offset of returned data to display data on pages. |
limit | The maximum number of returned entries in each call. |
To get all alerts on a specific date, you can set the interval between the start timestamp and the end timestamp to one day.
Example
mTyCameraMessage.getAlarmDetectionMessageList(devId, startTime, endTime, selectClassify.getMsgCode(), 0, 30, new ITuyaResultCallback<List<CameraMessageBean>>() {
@Override
public void onSuccess(List<CameraMessageBean> result) {
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
Data model of CameraMessageBean
Parameter | Description |
---|---|
dateTime | The date on which an alert occurs. |
time | The timestamp of an event. |
attachPics | The images of events in the array format. The first element of the array is used. |
attachVideos | The videos of events in the array format. The first element of the array is used. |
id | The event ID. |
msgSrcId | The alert ID. |
API description
void deleteMotionMessageList(List<String> ids, ITuyaResultCallback<Boolean> callback);
Parameters
Parameter | Description |
---|---|
ids | The list of IDs for the alerts to be deleted. |
Example
cameraMessage.deleteMotionMessageList(ids, new ITuyaResultCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {
}
@Override
public void onError(String errorCode, String errorMessage) {
}
});
API description
void destroy();
Example
if (null != mTyCameraMessage) {
mTyCameraMessage.destroy();
}
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback