Attachment information upload
When the alarm is triggered and the Device starts to upload the attachment, the server will push the attachment information to the client in real time, mainly including the number of files and other information. When the UI needs to display the upload status, this message can be processed, otherwise it can be ignored
websocket Header field information
Message method: Push
Message type: 8004
Push message definition
field | type | desc |
---|---|---|
hdr | object | Headers, Table 1 in login :websocket headers |
data | object | Attachment information, definitions View current page Table 1 |
Table 1: Attachment information
field | type | desc |
---|---|---|
alarmCode | string | Alarm ID, which corresponds to the alarmID in the alarm information |
deviceNo | string | Device number |
fileInfo | array | File information, definitions View current page Table 2 |
Table 2: File information
field | type | desc |
---|---|---|
totalSize | integer | File size, bytes |
fileName | string | filename |
Example
json
{
"hdr": {
"code": 200,
"message": "",
"msgType": 8004,
"reqSN": 1,
"respSN": 0
},
"data": {
"alarmCode":"15552123545556",
"deviceNo":"1300000001",
"fileInfo":[{
"totalSize":102400,
"fileName":"test.jpg"
},{
"totalSize":102400,
"fileName":"test1.mp4"
}]
}
}
{
"hdr": {
"code": 200,
"message": "",
"msgType": 8004,
"reqSN": 1,
"respSN": 0
},
"data": {
"alarmCode":"15552123545556",
"deviceNo":"1300000001",
"fileInfo":[{
"totalSize":102400,
"fileName":"test.jpg"
},{
"totalSize":102400,
"fileName":"test1.mp4"
}]
}
}
Attachment upload completion notice
When the Device uploads an attachment, the server will push a completion message to the client. If there are multiple attachments, the message includes the corresponding file information for status display. If the UI has no status display requirement, it can be ignored
websocket Header field information
Message method: Push
Message type: 8005
Push message definition
field | type | desc |
---|---|---|
hdr | object | Headers, Table 1 in login :websocket headers |
data | object | Complete file information, defined View current page Table 3 |
Table 3: Completed file information
field | type | desc |
---|---|---|
alarmCode | string | Alarm ID, which corresponds to the alarmID in the alarm information |
deviceNo | string | Device number |
fileName | string | File name |
Example
json
{
"hdr": {
"code": 200,
"message": "",
"msgType": 8004,
"reqSN": 1,
"respSN": 0
},
"data": {
"alarmCode":"15552123545556",
"deviceNo":"1300000001",
"fileInfo":[{
"totalSize":102400,
"fileName":"test.jpg"
},{
"totalSize":102400,
"fileName":"test1.mp4"
}]
}
}
{
"hdr": {
"code": 200,
"message": "",
"msgType": 8004,
"reqSN": 1,
"respSN": 0
},
"data": {
"alarmCode":"15552123545556",
"deviceNo":"1300000001",
"fileInfo":[{
"totalSize":102400,
"fileName":"test.jpg"
},{
"totalSize":102400,
"fileName":"test1.mp4"
}]
}
}