aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornamo <namo@gurtam.com>2017-12-04 13:48:43 +0300
committernamo <namo@gurtam.com>2017-12-04 13:48:43 +0300
commita067ab0240b0ac68c97f61fdadb53e7e063c8594 (patch)
tree8656c2d094aca2fbe4bd714dac437f1abc16d436
parentaa4a01126f9724dece194c9543927d60934ec2a6 (diff)
downloadtrackermap-server-a067ab0240b0ac68c97f61fdadb53e7e063c8594.tar.gz
trackermap-server-a067ab0240b0ac68c97f61fdadb53e7e063c8594.tar.bz2
trackermap-server-a067ab0240b0ac68c97f61fdadb53e7e063c8594.zip
flespi protocol remastered to receive data from stream; more parameters are converted into internal representation
-rw-r--r--src/org/traccar/protocol/FlespiProtocolDecoder.java278
-rw-r--r--test/org/traccar/protocol/FlespiProtocolDecoderTest.java6
2 files changed, 255 insertions, 29 deletions
diff --git a/src/org/traccar/protocol/FlespiProtocolDecoder.java b/src/org/traccar/protocol/FlespiProtocolDecoder.java
index d122df383..71f67b552 100644
--- a/src/org/traccar/protocol/FlespiProtocolDecoder.java
+++ b/src/org/traccar/protocol/FlespiProtocolDecoder.java
@@ -18,6 +18,10 @@ package org.traccar.protocol;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.handler.codec.http.HttpRequest;
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
+import org.jboss.netty.handler.codec.http.multipart.Attribute;
+import org.jboss.netty.handler.codec.http.multipart.DefaultHttpDataFactory;
+import org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder;
+import org.jboss.netty.handler.codec.http.multipart.InterfaceHttpData;
import org.traccar.BaseHttpProtocolDecoder;
import org.traccar.DeviceSession;
import org.traccar.model.Position;
@@ -27,12 +31,15 @@ import javax.json.JsonArray;
import javax.json.JsonNumber;
import javax.json.JsonObject;
import javax.json.JsonString;
+import javax.json.JsonValue;
import java.io.StringReader;
import java.net.SocketAddress;
-import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Iterator;
public class FlespiProtocolDecoder extends BaseHttpProtocolDecoder {
@@ -45,8 +52,16 @@ public class FlespiProtocolDecoder extends BaseHttpProtocolDecoder {
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
HttpRequest request = (HttpRequest) msg;
- JsonArray result = Json.createReader(new StringReader(request.getContent().toString(StandardCharsets.UTF_8)))
- .readArray();
+ HttpPostRequestDecoder decoder = new HttpPostRequestDecoder(new DefaultHttpDataFactory(false), request);
+ InterfaceHttpData data = decoder.getBodyHttpData("data");
+ if (data.getHttpDataType() != InterfaceHttpData.HttpDataType.Attribute) {
+ sendResponse(channel, HttpResponseStatus.BAD_REQUEST);
+ return null;
+ }
+
+ Attribute attribute = (Attribute) data;
+ String value = attribute.getValue();
+ JsonArray result = Json.createReader(new StringReader(value)).readArray();
List<Position> positions = new LinkedList<>();
for (int i = 0; i < result.size(); i++) {
JsonObject message = result.getJsonObject(i);
@@ -60,6 +75,7 @@ public class FlespiProtocolDecoder extends BaseHttpProtocolDecoder {
}
Position position = new Position();
position.setDeviceId(deviceSession.getDeviceId());
+ position.setProtocol(getProtocolName());
decodePosition(message, position);
positions.add(position);
}
@@ -69,36 +85,246 @@ public class FlespiProtocolDecoder extends BaseHttpProtocolDecoder {
}
private void decodePosition(JsonObject object, Position position) {
- position.setProtocol(getProtocolName());
+ // store all params in position
+ Set<Map.Entry<String, JsonValue>> params = object.entrySet();
+ Iterator<Map.Entry<String, JsonValue>> it = params.iterator();
+ while (it.hasNext()) {
+ Map.Entry<String, JsonValue> param = it.next();
+ String paramName = param.getKey();
+ JsonValue paramValue = param.getValue();
+ if ("timestamp".equals(paramName)) {
+ Date deviceTime = new Date((long) (((JsonNumber) paramValue).doubleValue() * 1000));
+ position.setTime(deviceTime);
+ } else if (paramName.startsWith("position.")) {
+ savePosition(paramName, paramValue, position);
+ } else if (paramName.matches("din#[\\d]{1,2}")) {
+ saveInput(paramName, paramValue, position);
+ } else if (paramName.matches("dout#[\\d]{1,2}")) {
+ saveOutput(paramName, paramValue, position);
+ } else if (saveAlarm(paramName, paramValue, position) == 0
+ && saveParam(paramName, paramValue, position) == 0) {
+ saveUnknownParam(param.getKey(), param.getValue(), position);
+ }
+ }
+ if (position.getLatitude() == 0 && position.getLongitude() == 0) {
+ getLastLocation(position, position.getDeviceTime());
+ }
+ }
- Date deviceTime = new Date((long) object.getJsonNumber("timestamp").doubleValue() * 1000);
- position.setTime(deviceTime);
- JsonNumber lat = object.getJsonNumber("position.latitude");
- JsonNumber lon = object.getJsonNumber("position.longitude");
- if (lat != null && lon != null) {
- position.setLatitude(lat.doubleValue());
- position.setLongitude(lon.doubleValue());
- } else {
- getLastLocation(position, deviceTime);
+ private void savePosition(String name, JsonValue value, Position position) {
+ switch (name) {
+ case "position.latitude":
+ position.setLatitude(((JsonNumber) value).doubleValue());
+ break;
+ case "position.longitude":
+ position.setLongitude(((JsonNumber) value).doubleValue());
+ break;
+ case "position.speed":
+ position.setSpeed(((JsonNumber) value).doubleValue());
+ break;
+ case "position.direction":
+ position.setCourse(((JsonNumber) value).doubleValue());
+ break;
+ case "position.altitude":
+ position.setAltitude(((JsonNumber) value).doubleValue());
+ break;
+ case "position.satellites":
+ position.set(Position.KEY_SATELLITES, ((JsonNumber) value).intValue());
+ break;
+ case "position.valid":
+ position.setValid(value == JsonValue.TRUE);
+ break;
+ case "position.hdop":
+ position.set(Position.KEY_HDOP, ((JsonNumber) value).doubleValue());
+ break;
+ case "position.pdop":
+ position.set(Position.KEY_PDOP, ((JsonNumber) value).doubleValue());
+ break;
+ default:
+ saveUnknownParam(name, value, position);
+ break;
+ }
+ }
+
+ private int saveParam(String name, JsonValue value, Position position) {
+ if (name == null) {
+ return 0;
+ }
+ if (name.equals("gps.vehicle.mileage") || name.startsWith("gps.vehicle.mileage#")) {
+ position.set(Position.KEY_ODOMETER, ((JsonNumber) value).doubleValue());
+ return 1;
+ }
+ if (name.equals("external.powersource.voltage") || name.startsWith("external.powersource.voltage#")) {
+ position.set(Position.KEY_POWER, ((JsonNumber) value).doubleValue());
+ return 1;
+ }
+ if (name.equals("battery.voltage") || name.startsWith("battery.voltage#")) {
+ position.set(Position.KEY_BATTERY, ((JsonNumber) value).doubleValue());
+ return 1;
+ }
+ if (name.equals("fuel.level") || name.equals("can.fuel.level")
+ || name.startsWith("fuel.level#") || name.startsWith("can.fuel.level#")) {
+ position.set(Position.KEY_FUEL_LEVEL, ((JsonNumber) value).doubleValue());
+ return 1;
+ }
+ if (name.equals("engine.rpm") || name.equals("can.engine.rpm")
+ || name.startsWith("engine.rpm#") || name.startsWith("can.engine.rpm#")) {
+ position.set(Position.KEY_RPM, ((JsonNumber) value).doubleValue());
+ return 1;
+ }
+ if (name.equals("can.engine.temperature") || name.startsWith("can.engine.temperature#")) {
+ int seqNum = 0;
+ if (name.contains("#")) {
+ try {
+ seqNum = Integer.parseInt(name.replaceAll("can\\.engine\\.temperature#", ""));
+ } catch (NumberFormatException e) {
+ seqNum = 0;
+ }
+ }
+ position.set(Position.PREFIX_TEMP + seqNum, ((JsonNumber) value).doubleValue());
+ return 1;
+ }
+ if (name.equals("engine.ignition.status")) {
+ position.set(Position.KEY_IGNITION, value == JsonValue.TRUE);
+ return 1;
+ }
+ if (name.equals("movement.status")) {
+ position.set(Position.KEY_MOTION, value == JsonValue.TRUE);
+ return 1;
+ }
+ if (name.equals("device.temperature")) {
+ position.set(Position.KEY_DEVICE_TEMP, ((JsonNumber) value).doubleValue());
+ return 1;
+ }
+ if (name.equals("ibutton.code")) {
+ position.set(Position.KEY_DRIVER_UNIQUE_ID, ((JsonString) value).getString());
+ return 1;
+ }
+ if (name.equals("vehicle.vin")) {
+ position.set(Position.KEY_VIN, ((JsonString) value).getString());
+ return 1;
+ }
+ return 0;
+ }
+
+ private int saveAlarm(String name, JsonValue value, Position position) {
+ if ("alarm.event.trigger".equals(name)) {
+ if (value == JsonValue.TRUE) {
+ position.set(Position.KEY_ALARM, Position.ALARM_GENERAL);
+ }
+ return 1;
+ }
+ if ("towing.event.trigger".equals(name) || "towing.alarm.status".equals(name)) {
+ if (value == JsonValue.TRUE) {
+ position.set(Position.KEY_ALARM, Position.ALARM_TOW);
+ }
+ return 1;
+ }
+ if ("geofence.event.enter".equals(name)) {
+ if (value == JsonValue.TRUE) {
+ position.set(Position.KEY_ALARM, Position.ALARM_GEOFENCE_ENTER);
+ }
+ return 1;
+ }
+ if ("geofence.event.exit".equals(name)) {
+ if (value == JsonValue.TRUE) {
+ position.set(Position.KEY_ALARM, Position.ALARM_GEOFENCE_EXIT);
+ }
+ return 1;
+ }
+ if ("shock.event.trigger".equals(name)) {
+ if (value == JsonValue.TRUE) {
+ position.set(Position.KEY_ALARM, Position.ALARM_SHOCK);
+ }
+ return 1;
}
- JsonNumber speed = object.getJsonNumber("position.speed");
- if (speed != null) {
- position.setSpeed(speed.doubleValue());
+ if ("overspeeding.event.trigger".equals(name)) {
+ if (value == JsonValue.TRUE) {
+ position.set(Position.KEY_ALARM, Position.ALARM_OVERSPEED);
+ }
+ return 1;
}
- JsonNumber course = object.getJsonNumber("position.direction");
- if (course != null) {
- position.setCourse(course.doubleValue());
+ if ("harsh.acceleration.event.trigger".equals(name)) {
+ if (value == JsonValue.TRUE) {
+ position.set(Position.KEY_ALARM, Position.ALARM_ACCELERATION);
+ }
+ return 1;
}
- JsonNumber altitude = object.getJsonNumber("position.altitude");
- if (altitude != null) {
- position.setAltitude(altitude.doubleValue());
+ if ("harsh.braking.event.trigger".equals(name)) {
+ if (value == JsonValue.TRUE) {
+ position.set(Position.KEY_ALARM, Position.ALARM_BRAKING);
+ }
+ return 1;
}
+ if ("harsh.cornering.event.trigger".equals(name)) {
+ if (value == JsonValue.TRUE) {
+ position.set(Position.KEY_ALARM, Position.ALARM_CORNERING);
+ }
+ return 1;
+ }
+ if ("gnss.antenna.cut.status".equals(name)) {
+ if (value == JsonValue.TRUE) {
+ position.set(Position.KEY_ALARM, Position.ALARM_GPS_ANTENNA_CUT);
+ }
+ return 1;
+ }
+ if ("gsm.jamming.event.trigger".equals(name)) {
+ if (value == JsonValue.TRUE) {
+ position.set(Position.KEY_ALARM, Position.ALARM_JAMMING);
+ }
+ return 1;
+ }
+ if ("hood.open.status".equals(name)) {
+ if (value == JsonValue.TRUE) {
+ position.set(Position.KEY_ALARM, Position.ALARM_BONNET);
+ }
+ return 1;
+ }
+ return 0;
+ }
+
+ private void saveInput(String name, JsonValue value, Position position) {
+ if (value != JsonValue.TRUE) {
+ return;
+ }
+ int in = Integer.parseInt(name.replaceAll("^din#", ""));
+ if (in > 32 || in < 1) {
+ return;
+ }
+ if (position.getInteger(Position.KEY_INPUT) == 0) {
+ position.set(Position.KEY_INPUT, 1 << (in - 1));
+ } else {
+ position.set(Position.KEY_INPUT, (position.getInteger(Position.KEY_INPUT) | 1 << (in - 1)));
+ }
+ }
- position.setValid(object.getBoolean("position.valid", true));
- position.set(Position.KEY_SATELLITES, object.getInt("position.satellites", 0));
+ private void saveOutput(String name, JsonValue value, Position position) {
+ if (value != JsonValue.TRUE) {
+ return;
+ }
+ int out = Integer.parseInt(name.replaceAll("^dout#", ""));
+ if (out > 32 || out < 1) {
+ return;
+ }
+ if (position.getInteger(Position.KEY_OUTPUT) == 0) {
+ position.set(Position.KEY_OUTPUT, 1 << (out - 1));
+ } else {
+ position.set(Position.KEY_OUTPUT, (position.getInteger(Position.KEY_OUTPUT) | 1 << (out - 1)));
+ }
+ }
- if (object.getBoolean("alarm.event.trigger", false)) {
- position.set(Position.KEY_ALARM, Position.ALARM_GENERAL);
+ private void saveUnknownParam(String name, JsonValue value, Position position) {
+ if (value instanceof JsonNumber) {
+ if (((JsonNumber) value).isIntegral()) {
+ position.set(name, ((JsonNumber) value).longValue());
+ } else {
+ position.set(name, ((JsonNumber) value).doubleValue());
+ }
+ position.set(name, ((JsonNumber) value).doubleValue());
+ } else if (value instanceof JsonString) {
+ position.set(name, ((JsonString) value).getString());
+ } else if (value == JsonValue.TRUE || value == JsonValue.FALSE) {
+ position.set(name, value == JsonValue.TRUE);
}
}
}
diff --git a/test/org/traccar/protocol/FlespiProtocolDecoderTest.java b/test/org/traccar/protocol/FlespiProtocolDecoderTest.java
index b23da024a..47a7d623c 100644
--- a/test/org/traccar/protocol/FlespiProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/FlespiProtocolDecoderTest.java
@@ -12,13 +12,13 @@ public class FlespiProtocolDecoderTest extends ProtocolTest {
FlespiProtocolDecoder decoder = new FlespiProtocolDecoder(new FlespiProtocol());
verifyPositions(decoder, request(HttpMethod.POST, "/",
- buffer("[{\"position.speed\":0,\"position.latitude\":53.90573,\"time.valid.status\":true,\"timestamp\":1506956075,\"position.satellites\":10,\"message.buffered.status\":false,\"business.mode.status\":true,\"gps.status\":true,\"position.longitude\":27.455848,\"position.direction\":0,\"ident\":\"605630\"},{\"siren.status\":false,\"business.mode.status\":true,\"position.satellites\":8,\"timestamp\":1506695785,\"led.status\":false,\"position.latitude\":53.905569,\"position.longitude\":27.455986,\"position.speed\":0,\"gradual.stop.status\":false,\"position.direction\":262.643854,\"hardware.version.enum\":223,\"vehicle.mileage\":160,\"message.buffered.status\":false,\"blinkers.status\":false,\"ident\":\"605630\",\"position.altitude\":233.48,\"immobilizer.status\":false}]")));
+ buffer("data=[{\"position.speed\":0,\"position.latitude\":53.90573,\"time.valid.status\":true,\"timestamp\":1506956075,\"position.satellites\":10,\"message.buffered.status\":false,\"business.mode.status\":true,\"gps.status\":true,\"position.longitude\":27.455848,\"position.direction\":0,\"ident\":\"605630\"},{\"siren.status\":false,\"business.mode.status\":true,\"position.satellites\":8,\"timestamp\":1506695785,\"led.status\":false,\"position.latitude\":53.905569,\"position.longitude\":27.455986,\"position.speed\":0,\"gradual.stop.status\":false,\"position.direction\":262.643854,\"hardware.version.enum\":223,\"vehicle.mileage\":160,\"message.buffered.status\":false,\"blinkers.status\":false,\"ident\":\"605630\",\"position.altitude\":233.48,\"immobilizer.status\":false}]")));
verifyPositions(decoder, request(HttpMethod.POST, "/",
- buffer("[{\"geofence.inside.status\":false,\"position.valid\":false,\"ain#4\":0,\"rs232.sensor.value#1\":0,\"position.direction\":0,\"rs232.sensor.value#0\":0,\"position.speed\":0,\"position.latitude\":0,\"refrigerator.sensor.temperature#1\":62.5,\"gnss.antenna.cut.status\":true,\"din#4\":3,\"ain#3\":0,\"refrigerator.sensor.temperature#3\":71.4,\"position.altitude\":0,\"din#2\":3,\"shock.event.trigger\":false,\"alarm.mode.status\":false,\"ibutton.event.connect\":false,\"refrigerator.sensor.temperature#4\":66.7,\"internal.battery.voltage.limit.lower.status\":false,\"ain#2\":0,\"gsm.signal.level\":0,\"refrigerator.connection.status\":0,\"position.satellites\":0,\"din#1\":3,\"external.powersource.voltage.range.outside.status\":false,\"refrigerator.sensor.temperature#2\":68.2,\"incline.event.trigger\":false,\"alarm.event.trigger\":false,\"movement.status\":true,\"refrigerator.sensor.temperature#6\":68.9,\"ident\":\"50\",\"timestamp\":946684840,\"engine.ignition.status\":true,\"gsm.sim.status\":true,\"record.seqnum\":8165,\"external.powersource.voltage\":15.298,\"gnss.enum\":\"glonass\",\"position.longitude\":0,\"battery.voltage\":4.088,\"refrigerator.sensor.temperature#5\":71.3,\"din#3\":3,\"ain#1\":0,\"internal.bus.supply.voltage.range.outside.status\":false},{\"geofence.inside.status\":false,\"position.valid\":true,\"ain#4\":0,\"rs232.sensor.value#1\":0,\"position.direction\":0,\"rs232.sensor.value#0\":0,\"position.speed\":0,\"position.latitude\":57.986744,\"refrigerator.sensor.temperature#1\":74.1,\"gnss.antenna.cut.status\":false,\"din#4\":3,\"ain#3\":0,\"position.hdop\":21.1,\"refrigerator.sensor.temperature#3\":71.4,\"position.altitude\":219,\"din#2\":3,\"shock.event.trigger\":false,\"alarm.mode.status\":false,\"ibutton.event.connect\":false,\"refrigerator.sensor.temperature#4\":70.5,\"internal.battery.voltage.limit.lower.status\":false,\"ain#2\":0,\"gsm.signal.level\":0,\"refrigerator.connection.status\":0,\"position.satellites\":5,\"din#1\":3,\"external.powersource.voltage.range.outside.status\":false,\"refrigerator.sensor.temperature#2\":71.3,\"incline.event.trigger\":false,\"alarm.event.trigger\":false,\"movement.status\":true,\"refrigerator.sensor.temperature#6\":69.3,\"ident\":\"50\",\"timestamp\":1392272112,\"engine.ignition.status\":true,\"gsm.sim.status\":true,\"record.seqnum\":8174,\"external.powersource.voltage\":15.303,\"gnss.enum\":\"glonass\",\"position.longitude\":56.207576,\"battery.voltage\":3.934,\"refrigerator.sensor.temperature#5\":68.1,\"din#3\":3,\"ain#1\":0,\"internal.bus.supply.voltage.range.outside.status\":false}]")));
+ buffer("data=[{\"geofence.inside.status\":false,\"position.valid\":false,\"ain#4\":0,\"rs232.sensor.value#1\":0,\"position.direction\":0,\"rs232.sensor.value#0\":0,\"position.speed\":0,\"position.latitude\":10.11223,\"refrigerator.sensor.temperature#1\":62.5,\"gnss.antenna.cut.status\":true,\"din#4\":3,\"ain#3\":0,\"refrigerator.sensor.temperature#3\":71.4,\"position.altitude\":0,\"din#2\":3,\"shock.event.trigger\":false,\"alarm.mode.status\":false,\"ibutton.event.connect\":false,\"refrigerator.sensor.temperature#4\":66.7,\"internal.battery.voltage.limit.lower.status\":false,\"ain#2\":0,\"gsm.signal.level\":0,\"refrigerator.connection.status\":0,\"position.satellites\":0,\"din#1\":3,\"external.powersource.voltage.range.outside.status\":false,\"refrigerator.sensor.temperature#2\":68.2,\"incline.event.trigger\":false,\"alarm.event.trigger\":false,\"movement.status\":true,\"refrigerator.sensor.temperature#6\":68.9,\"ident\":\"605630\",\"timestamp\":946684840,\"engine.ignition.status\":true,\"gsm.sim.status\":true,\"record.seqnum\":8165,\"external.powersource.voltage\":15.298,\"gnss.enum\":\"glonass\",\"position.longitude\":20.88774,\"battery.voltage\":4.088,\"refrigerator.sensor.temperature#5\":71.3,\"din#3\":3,\"ain#1\":0,\"internal.bus.supply.voltage.range.outside.status\":false},{\"geofence.inside.status\":false,\"position.valid\":true,\"ain#4\":0,\"rs232.sensor.value#1\":0,\"position.direction\":0,\"rs232.sensor.value#0\":0,\"position.speed\":0,\"position.latitude\":57.986744,\"refrigerator.sensor.temperature#1\":74.1,\"gnss.antenna.cut.status\":false,\"din#4\":3,\"ain#3\":0,\"position.hdop\":21.1,\"refrigerator.sensor.temperature#3\":71.4,\"position.altitude\":219,\"din#2\":3,\"shock.event.trigger\":false,\"alarm.mode.status\":false,\"ibutton.event.connect\":false,\"refrigerator.sensor.temperature#4\":70.5,\"internal.battery.voltage.limit.lower.status\":false,\"ain#2\":0,\"gsm.signal.level\":0,\"refrigerator.connection.status\":0,\"position.satellites\":5,\"din#1\":3,\"external.powersource.voltage.range.outside.status\":false,\"refrigerator.sensor.temperature#2\":71.3,\"incline.event.trigger\":false,\"alarm.event.trigger\":false,\"movement.status\":true,\"refrigerator.sensor.temperature#6\":69.3,\"ident\":\"605630\",\"timestamp\":1392272112,\"engine.ignition.status\":true,\"gsm.sim.status\":true,\"record.seqnum\":8174,\"external.powersource.voltage\":15.303,\"gnss.enum\":\"glonass\",\"position.longitude\":56.207576,\"battery.voltage\":3.934,\"refrigerator.sensor.temperature#5\":68.1,\"din#3\":3,\"ain#1\":0,\"internal.bus.supply.voltage.range.outside.status\":false}]")));
verifyPositions(decoder, request(HttpMethod.POST, "/",
- buffer("[{\"ain#1\":1,\"ain#2\":0,\"ain#3\":0,\"ain#4\":0,\"alarm.event.trigger\":true,\"custom.SOS\":1,\"custom.dparam\":3.141593,\"custom.ign\":1,\"custom.iparam\":-55,\"custom.tparam\":\"lorem\",\"din#1\":false,\"din#10\":false,\"din#11\":false,\"din#12\":false,\"din#13\":false,\"din#14\":false,\"din#15\":false,\"din#16\":false,\"din#17\":false,\"din#18\":false,\"din#19\":false,\"din#2\":false,\"din#20\":false,\"din#21\":false,\"din#22\":false,\"din#23\":false,\"din#24\":false,\"din#25\":false,\"din#26\":false,\"din#27\":false,\"din#28\":false,\"din#29\":false,\"din#3\":false,\"din#30\":false,\"din#31\":false,\"din#32\":false,\"din#4\":false,\"din#5\":false,\"din#6\":false,\"din#7\":false,\"din#8\":false,\"din#9\":false,\"dout#1\":false,\"dout#10\":false,\"dout#11\":false,\"dout#12\":false,\"dout#13\":false,\"dout#14\":false,\"dout#15\":false,\"dout#16\":false,\"dout#17\":false,\"dout#18\":false,\"dout#19\":false,\"dout#2\":false,\"dout#20\":false,\"dout#21\":false,\"dout#22\":false,\"dout#23\":false,\"dout#24\":false,\"dout#25\":false,\"dout#26\":false,\"dout#27\":false,\"dout#28\":false,\"dout#29\":false,\"dout#3\":false,\"dout#30\":false,\"dout#31\":false,\"dout#32\":false,\"dout#4\":false,\"dout#5\":false,\"dout#6\":false,\"dout#7\":false,\"dout#8\":false,\"dout#9\":false,\"ident\":\"namo:namo\",\"position.altitude\":300,\"position.direction\":0,\"position.hdop\":1.1,\"position.latitude\":53.90821,\"position.longitude\":27.524165,\"position.satellites\":7,\"position.speed\":0,\"timestamp\":1508508510.013227}]")));
+ buffer("data=[{\"ain#1\":1,\"ain#2\":0,\"ain#3\":0,\"ain#4\":0,\"alarm.event.trigger\":true,\"custom.SOS\":1,\"custom.dparam\":3.141593,\"custom.ign\":1,\"custom.iparam\":-55,\"custom.tparam\":\"lorem\",\"din#1\":false,\"din#10\":false,\"din#11\":false,\"din#12\":false,\"din#13\":false,\"din#14\":false,\"din#15\":false,\"din#16\":false,\"din#17\":false,\"din#18\":false,\"din#19\":false,\"din#2\":false,\"din#20\":false,\"din#21\":false,\"din#22\":false,\"din#23\":false,\"din#24\":false,\"din#25\":false,\"din#26\":false,\"din#27\":false,\"din#28\":false,\"din#29\":false,\"din#3\":false,\"din#30\":false,\"din#31\":false,\"din#32\":false,\"din#4\":false,\"din#5\":false,\"din#6\":false,\"din#7\":false,\"din#8\":false,\"din#9\":false,\"dout#1\":false,\"dout#10\":false,\"dout#11\":false,\"dout#12\":false,\"dout#13\":false,\"dout#14\":false,\"dout#15\":false,\"dout#16\":false,\"dout#17\":false,\"dout#18\":false,\"dout#19\":false,\"dout#2\":false,\"dout#20\":false,\"dout#21\":false,\"dout#22\":false,\"dout#23\":false,\"dout#24\":false,\"dout#25\":false,\"dout#26\":false,\"dout#27\":false,\"dout#28\":false,\"dout#29\":false,\"dout#3\":false,\"dout#30\":false,\"dout#31\":false,\"dout#32\":false,\"dout#4\":false,\"dout#5\":false,\"dout#6\":false,\"dout#7\":false,\"dout#8\":false,\"dout#9\":false,\"ident\":\"namo:namo\",\"position.altitude\":300,\"position.direction\":0,\"position.hdop\":1.1,\"position.latitude\":53.90821,\"position.longitude\":27.524165,\"position.satellites\":7,\"position.speed\":0,\"timestamp\":1508508510.013227}]")));
}
} \ No newline at end of file