Example Description
Some field data may be meaningless due to different equipment types. If it is not available, it can be ignored
1.Positioning data
[HttpPost]
public MBackResult ReceiveLocationData([FromBody]TerminalLocation parm)
{
Log.Instance.Info("Positioning data:" + JsonConvert.SerializeObject(parm));
MBackResult result = new MBackResult();
result.Result = 200;
return result;
}
TerminalLocation:
/// <summary>
/// Positioning data
/// </summary>
public class TerminalLocation
{
/// <summary>
/// Equipment No
/// </summary>
public string assetId { get; set; }
/// <summary>
/// longitude(WGS-84)
/// </summary>
public double longitude { get; set; } = 0.0;
/// <summary>
/// latitude(WGS-84)
/// </summary>
public double latitude { get; set; } = 0.0;
/// <summary>
/// speed(km/h)
/// </summary>
public int speed{ get; set; }
/// <summary>
/// direction(0~360)
/// </summary>
public int direction { get; set; } = 0;
/// <summary>
/// mileage(km)
/// </summary>
public long mileage { get; set; } = 0L;
/// <summary>
/// Positioning time(UTC)
/// </summary>
public string gpsTime { get; set; }
/// <summary>
/// Receiving time(UTC)
/// </summary>
public string recvTime { get; set; }
/// <summary>
/// Positioning type (0: no positioning; 1: GPS positioning; 2: base station positioning;3:Cells positioning)
/// </summary>
public int locType { get; set; } = 0;
/// <summary>
/// GPRS signal
/// </summary>
public int cellSignal { get; set; } = 0;
/// <summary>
/// Satellite signal
/// </summary>
public int gnssSignal { get; set; } = 0;
/// <summary>
/// Cell code data, MNC, MCC, LAC, CID
/// </summary>
public string cells { get; set; }
/// <summary>
/// Power
/// </summary>
public int battery { get; set; }
/// <summary>
/// Voltage(V)
/// </summary>
public string voltage { get; set; }
/**
* Lock/vehicle status JSON
*/
public string statusJson { get; set; }
/**
* Extension information JSON
*/
public string expandInfo { get; set; }
}
Lock/vehicle status JSON
/// <summary>
/// Lock/vehicle status
/// </summary>
public class StatusJson
{
/// JSON description of lock status information (for electronic lock devices)
/// <summary>
/// Rope locking status (1: pulling out 0: inserting - 1: none)
/// </summary>
public int lockRope { get; set; }
/// <summary>
/// Lock status (0: Off 1: On)
/// </summary>
public int lockStatus { get; set; }
///JSON description of on-board status information (for GP series, ministerial equipment and other vehicle equipment)
/// <summary>
/// ACC status (1: On 0: Off 1: None)
/// </summary>
public int acc { get; set; }
/// <summary>
/// State of oil cut-off electric switch (1: On 0: Off 1: None)
/// </summary>
public int fuelCut { get; set; }
/// <summary>
/// Door opening/closing status (1: open 0: close - 1: none)
/// </summary>
public int door { get; set; }
/// <summary>
/// Engine status (1: On 0: Off 1: None)
/// </summary>
public int engine { get; set; }
}
JSON description of extension information
/// <summary>
/// Extended Fields
/// </summary>
public class ExpandInfo
{
/// <summary>
/// Temperature - 1000 means none
/// </summary>
public int temperature { get; set; }
/// <summary>
/// Humidity 0 means none
/// </summary>
public int humidity { get; set; }
/// <summary>
/// Oil level value - 1 means none ("- 1, - 1, - 1")
/// </summary>
public int fuels { get; set; }
/// <summary>
/// acceleration(formats:"x: 1; y: - 29; z: - 2903")
/// </summary>
public string acceleration { get; set; }
/// <summary>
/// Illuminance(lux)
/// </summary>
public float lux { get; set; }
/// <summary>
/// pressure(pa)
/// </summary>
public float pressure { get; set; }
/// <summary>
/// posture (formats:"x: 1; y: - 29; z: - 2903")
/// </summary>
public string fPosture { get; set; }
/// <summary>
/// Spare battery (formats:"55,3.88,0")
/// </summary>
public string backBattery { get; set; }
/// <summary>
/// Data type 0: real-time; 1: Supplementary report; 2: Alarm
/// </summary>
public int reportType { get; set; }
/// <summary>
/// Network type 0: unknown 1:1G 2:2G 3:3G 4:4: G 5:5G Others are not displayed
/// </summary>
public int networkType { get; set; }
}
2.Alarm data
[HttpPost]
public MBackResult ReceiveAlarmData([FromBody]TerminalAlarm parm)
{
Log.Instance.Warn("Alarm data:" + JsonConvert.SerializeObject(parm));
MBackResult result = new MBackResult();
result.Result = 200;
return result;
}
TerminalAlarm:
/// <summary>
/// Alarm data
/// </summary>
public class TerminalAlarm
{
/// <summary>
/// Equipment No
/// </summary>
public string assetId { get; set; }
/// <summary>
/// Alarm type (refer to the following description of alarm type)
/// </summary>
public int alarmType { get; set; }
/// <summary>
/// Time (UTC time)
/// </summary>
public string dateTime { get; set; }
/// <summary>
/// longitude(WGS-84)
/// </summary>
public double longitude { get; set; } = 0.0;
/// <summary>
/// latitude(WGS-84)
/// </summary>
public double latitude { get; set; } = 0.0;
/// <summary>
/// speed(km/h)
/// </summary>
public int speed { get; set; }
/// <summary>
/// mileage(km)
/// </summary>
public long mileage { get; set; }
/// <summary>
/// Cell code data is displayed in MNC, MCC, LAC and CID formats
/// </summary>
public string cells { get; set; }
/// <summary>
/// alarm describe
/// </summary>
public string describe { get; set; }
/// <summary>
/// Serial number of files
/// </summary>
public string fileIndex{ get; set; }
}
3.Event data
[HttpPost]
public MBackResult ReceiveEventData([FromBody]TerminalEvent parm)
{
Log.Instance.Warn("Event data:" + JsonConvert.SerializeObject(parm));
MBackResult result = new MBackResult();
result.Result = 200;
return result;
}
TerminalEvent:
/// <summary>
/// Event data
/// </summary>
public class TerminalEvent
{
/// <summary>
/// Equipment No
/// </summary>
public string assetId { get; set; }
/// <summary>
/// Event type (1:Unlock;2:Lock;3:Sealing of exit area;;4:Unblock the entrance area;5:Open box(door);6:Close box(door))
/// </summary>
public int eventType { get; set; }
/// <summary>
/// Unlocking type, only for lock on/off events (1: swipe card to unlock 2: remote unlock 3: Bluetooth unlock 4: cut rope to unlock 5: SMS unlock 6: regional trigger)
/// </summary>
public int unLockType { get; set; }
/// <summary>
/// Time (UTC time)
/// </summary>
public string dateTime { get; set; }
/// <summary>
/// longitude(WGS-84)
/// </summary>
public double longitude { get; set; } = 0.0;
/// <summary>
/// latitude(WGS-84)
/// </summary>
public double latitude { get; set; } = 0.0;
/// <summary>
/// speed(km/h)
/// </summary>
public int speed { get; set; }
/// <summary>
/// mileage(km)
/// </summary>
public long mileage { get; set; }
/// <summary>
/// Cell code data is displayed in MNC, MCC, LAC and CID formats
/// </summary>
public string cells { get; set; }
/// <summary>
/// Swipe card No,only for lock products
/// </summary>
public string card { get; set; }
/// <summary>
/// unlock password,only for lock products
/// </summary>
public string password { get; set; }
}
4.Command response data
[HttpPost]
public MBackResult ReceiveInsData([FromBody]TerminalCommand parm)
{
Log.Instance.Warn("Command response data:" + JsonConvert.SerializeObject(parm));
MBackResult result = new MBackResult();
result.Result = 200;
return result;
}
TerminalCommand:
/// <summary>
/// Command response data
/// </summary>
public class TerminalCommand
{
/// <summary>
/// Equipment No
/// </summary>
public string assetId { get; set; }
/// <summary>
/// Command type
/// </summary>
public string commandType { get; set; }
/// <summary>
/// Equipment response content
/// </summary>
public string content { get; set; }
/// <summary>
/// Time (UTC time)
/// </summary>
public string dateTime { get; set; }
}
5、Slave Data
[HttpPost]
public MBackResult ReceiveInsData([FromBody]SlaveMachineLocation parm)
{
Log.Instance.Warn("slave data:" + JsonConvert.SerializeObject(parm));
MBackResult result = new MBackResult();
result.Result = 200;
return result;
}
SlaveMachineLocation
/// <summary>
/// slave data
/// </summary>
public class SlaveMachineLocation
{
/// <summary>
/// Equipment No
/// </summary>
public string assetId { get; set; }
/// <summary>
/// longitude(WGS-84)
/// </summary>
public double longitude { get; set; } = 0.0;
/// <summary>
/// latitude(WGS-84)
/// </summary>
public double latitude { get; set; } = 0.0;
/// <summary>
/// speed(km/h)
/// </summary>
public int speed{ get; set; }
/// <summary>
/// direction(0~360)
/// </summary>
public int direction { get; set; } = 0;
/// <summary>
/// mileage(km)
/// </summary>
public long mileage { get; set; } = 0L;
/// <summary>
/// Positioning time(UTC)
/// </summary>
public string gpsTime { get; set; }
/// <summary>
/// Receiving time(UTC)
/// </summary>
public string recvTime { get; set; }
/// <summary>
/// Slave Positioning time(UTC)
/// </summary>
public string subGpsTime { get; set; }
/// <summary>
/// Slave Power
/// </summary>
public int battery { get; set; }
/// <summary>
/// Slave Voltage
/// </summary>
public string voltage { get; set; }
/// <summary>
/// SLAVE Equipment No
/// </summary>
public string subAssetID { get; set; }
/// <summary>
/// SLAVE Type 1-JT126 , 4-JT709 , 5-JT801 , 6-JT802
/// </summary>
public int sensorType { get; set; }
/// <summary>
/// For 802 device status data (Json string), other types of device data can be ignored
/// </summary>
public string statusJson { get; set; }
/// <summary>
/// Slave lock status 0-Off 1-On
/// </summary>
public int locStatus { get; set; }
/// <summary>
/// Slave Rope locking status (1: pulling out 0: inserting - 1: none)
/// </summary>
public int locRope { get; set; }
/// <summary>
///RSSI
/// </summary>
public int rssi { get; set; }
/// <summary>
/// Slave Temperature - 1000 means none
/// </summary>
public double temperature { get; set; } = -1000.0;
/// <summary>
/// Slave Humidity 0 means none
/// </summary>
public int humidity { get; set; }
/// <summary>
/// Slave Event -1:none 0:Lock event 1:BLE unlock event 2:Open back cover waring 3:Lora unlock event 4:Lock rope cut warning 5:Key wake up event 6:Heartbeat packet 7:Charging report event 8/20:Pull out the lock rope event 9:RFID unlock event 10:Illegal RFID unlock warning 14:Sub lock signal lost warning 15:Valve closed event 16:Valve open event 17:Low battery warning 18:Anti-disassembly 19:Disassembly of electronic compartment 21:Lock rope insertion 22:Bluetooth connection 23:Open emergency storage warning 24:Close emergency storage warning 25:Valve abnormally open warning 26:Turn off the knob event 27:Turn on the knob event 28:Unlocking Error 29:Abnormal Motor 30:NFC trigger
/// </summary>
public int eventType { get; set; } = -1;
/// <summary>
/// Slave locking times
/// </summary>
public int locTimes { get; set; }
/// <summary>
/// Slave Positioning timestamp
/// </summary>
public long subGpsTimestamp { get; set; }
}
文档更新时间: 2023-12-07 16:26 作者:admin