function onhttpmessage(url,json)
{
var algorithmName=GetJSONData(json,'algorithmName');
var cameraId=GetJSONData(json,'cameraId');
var cameraName=GetJSONData(json,'cameraName');
var cameraPosition=GetJSONData(json,'cameraPosition');
var details=GetJSONData(json,'details');
var eventId=GetJSONData(json,'eventId');
var eventTime=GetJSONData(json,'eventTime');
var status=GetJSONData(json,'status');
var thumbnail=GetJSONData(json,'thumbnail');
alert('cameraId='+cameraId+' ;'+'algorithmName='+algorithmName+' ;'+'cameraName='+cameraName+'; '+'details='+details+' ;'+'eventId='+eventId+'; '+'eventTime='+eventTime+'; '+'status='+status+' ;'+'thumbnail='+thumbnail+' ;'+'cameraPosition='+cameraPosition);
WriteToTag('Simulator.d1.1.algorithmName',algorithmName);
WriteToTag('Simulator.d1.1.cameraId',cameraId);
WriteToTag('Simulator.d1.1.cameraName',cameraName);
WriteToTag('Simulator.d1.1.cameraPosition',cameraPosition);
WriteToTag('Simulator.d1.1.details',details);
WriteToTag('Simulator.d1.1.eventId',eventId);
WriteToTag('Simulator.d1.1.eventTime',eventTime);
WriteToTag('Simulator.d1.1.status',status);
WriteToTag('Simulator.d1.1.thumbnail',thumbnail);
}
HttpServer(3000,'/devices/report','onhttpmessage');
网关作为httpServer接收数据
2023-08-11