JsonP Interface File

  1. 1.General description

Item

Name

Remarks

1

Port Request

Utilize JsonP, detailed remarks at http://zh.wikipedia.org/wiki/JSONP

2

Data Type

Port answer to Json data all use string, integer 1 is also described as string “1”

3

Device ID

The unique ID of device

4

Time

All time are integer, from 1970-01-01 00:00:00 to current time. Time zone is not included. APP uses the cellphone time.

5

Coordinates

Coordinates uses degree as unit. Port coordinates are real data, in map, correction is needed.

6

Speed

km/h.

7

Angle

0-360 degrees, 0 means due north

  1. 2.Data Format of Port Request

Item

Name

Remarks

1

Request Format

http://www.test.net/Interface/AppJson.asp?Cmd=commandName&Data='request parameter'&Field=display field&callback=callback function Name

2

Remark

www.test.net

Server IP

JsonP.asp

Fixed request file

Cmd

Command Name

Data

Request data, multiple data, format N'data1',N'data2',N'data3'

Field

Data that needs to display while call back. Leave empty, show all data. It is used to reduce data flow when request big data.

callback

JsonP callback function Name

3

example

http://www.test.net/Interface/AppJson.asp?Cmd=Proc_GetCarInfo&Data=N'00012836'&Field=&Callback=JsonP2

 

  1. 3.Return data Remarks

Item

Name

Remarks

1

Return format

JsonP1({

              "m_isResultOk":1,

              "m_arrField":["field 1","field 2","field 3","field 4"],

              "m_arrRecord":[

                             ["value11","value12","value13","value14"],

                             ["value21","value22","value23","value24"],

                             ["value31","value32","value33","value34"],

                             ["value41","value42","value43","value44"],

              ]

});

2

Remark 

JsonP1

Jsonp response callback function

m_isResultOk

Request result, 0/fail, 1/success

m_arrField

Return result field array

m_arrRecord

Return result table content, composed of multiple filed array

 

Item

Name

Remarks

1

Request command

http://www.test.net/Interface/AppJson.asp?Cmd=Proc_Login&Data=N'User',N'strPassword'&Field=&Callback=JsonP5

2

Parameter

Proc_Login

Login command

N'User'

User ID,Must, Length 2-23

N'strSubUser'

Password, Must, Length 2-23

JsonP5

callback function

3

Response Content

JsonP5({

"m_isResultOk":1,

"m_arrField":["Result"],

"m_arrRecord":[["1"]]

})

4

Response Remarks

m_isResultOk

read-write database, 1/success, 0/fail.

Result

Logic operation resultfield 

1

Logic operation result,1/success, 0/fail.






 

  1. 5.Request User information 

Item

Name

Remarks

1

Request command

http://www.test.net/Interface/AppJson.asp?Cmd=Proc_GetUser&Data=N'User'&Field=&Callback=JsonP5

2

Parameter

Proc_GetUser

request User information  command

N'User'

User ID,Must, Length 2-23

JsonP5

callback function

3

Response Content

Json5({

"m_isResultOk":1,

"m_arrField":["nID","strUser","strPassword","strName","strTel","strCompany","strAddress","strEmail","strRemark","nLimitSubUser","nLimitCar","nLimitCtrlTE","nLimitClientSoft","nTimeout","strOpenID","nServerTime"],

"m_arrRecord":[["205","XXWL","686868","欣欣物流","18688955956","深圳市欣欣物流有限公司","深圳市龙华新区民治华通源C2106-112","","","0","0","0","64","1428681600","o2hZouPyJ8E5ocLwSUKTqLa-IIZ8","1418835573"]]

})

4

Response Remarks

m_isResultOk

read-write database, 1/success, 0/fail.

nID

record Item

strUser

account

strPassword

Password

strName

User 

strTel

User cell

strCompany

Company

strAddress

address

strEmail

User email

strRemark

remark

nLimitSubUser

Sub-user quantity limit

nLimitCar

Device quantity limit

nLimitCtrlTE

Null

nLimitClientSoft

Null

nTimeout

Expire time

strOpenID

Null

nServerTime

Null






 

  1. 6.Request User Sub-account device information 

Item

Name

Remarks

1

Request command

http://www.test.net/Interface/AppJson.asp?Cmd=Proc_GetCar&Data=N'strUser'&Field=&Callback=JsonP2

2

Parameter

Proc_GetCar

request User Sub-account device information command

N'strUser'

User ID

JsonP2

callback functionID

3

Response Content

JsonP2({

"m_isResultOk":1,

"m_arrField":["nID","strTEID","strCarNum","strTESim","nTEType","strGroupName","strOwnerName","strOwnerTel","strOwnerAddress","strRemark","strIconID","nFuelBoxSize","nMileageInit","nInterval","nOverSpeed","nSMSNoticeState","strSMSNoticeTel1","strSMSNoticeTel2","strSMSNoticeTel3","strNoticeEmail1","strNoticeEmail2","strNoticeEmail3","strPassword","nCreateTime","nSwitchType","strInfo","strOpenID","strDeviceID","nLimitTime","strProvinceID","strCityID","strFactoryID","strDeviceModel","strPlateColorID","strPlateNum"],

"m_arrRecord":[["288","00012836","BP6063","13789812644","10242","深圳市全程运通物流有限公司","李茂林2","13570839135","31","2014412日到期","0","1","0","0","0","0","null","null","null","null","null","null","","1393212323","0","","null","00012836","1441326757","null","null","null","null","null","null"]]

})

4

Response Remarks

nID

table record Item

strNoticeEmail1

Owner email 1

strTEID

Device IMEI

strNoticeEmail2

Owner email2

strCarNum

Device Name

strNoticeEmail3

Owner email 3

strTESim

Device Sim

strPassword

Device Password

nTEType

Device type

nCreateTime

Create time

strGroupName

Company ID

nSwitchType

Switch type

strOwnerName

Owner name

strInfo

information

strOwnerTel

Owner tel

strOpenID

Wechat ID

strOwnerAddress

Ownder address

strDeviceID

Device ID

strRemark

remark

nLimitTime

Expire time

strIconID

Icon ID

strProvinceID

Province

nFuelBoxSize

Tank volume

strCityID

City 

nMileageInit

Initial value

strFactoryID

Factory Name

nInterval

Gprs interval

strDeviceModel

Device model

nOverSpeed

Over speed value

strPlateColorID

Plate color

nSMSNoticeState

SMS notice state

strPlateNum

Car plate

strSMSNoticeTel1

Phone number1

strSMSNoticeTel2

Phone number3

strSMSNoticeTel3

Phone number3

5

Device valid

If Request information has Requested 3 times without information Return , but Return Request succeed, it means this device is not valid at platform. Invalid device could also have past location and history report.

6

Device expire

Return string nLimitTime, expire time. If it is 0, means forever valid, if UTC time is less than current time, device expires.








 

 

  1. 7.Request single device information

Item

Name

Remarks

1

Request command

http://www.test.net/Interface/AppJson.asp?Cmd=Proc_GetCarInfo&Data=N'00012836'&Field=&Callback=JsonP2

2

Parameter

Proc_GetCarInfo

Request car information commandName

N'00012836'

Device IMEI

JsonP2

callback functionID

3

Response Content

JsonP2({

"m_isResultOk":1,

"m_arrField":["nID","strTEID","strCarNum","strTESim","nTEType","strGroupName","strOwnerName","strOwnerTel","strOwnerAddress","strRemark","strIconID","nFuelBoxSize","nMileageInit","nInterval","nOverSpeed","nSMSNoticeState","strSMSNoticeTel1","strSMSNoticeTel2","strSMSNoticeTel3","strNoticeEmail1","strNoticeEmail2","strNoticeEmail3","strPassword","nCreateTime","nSwitchType","strInfo","strOpenID","strDeviceID","nLimitTime","strProvinceID","strCityID","strFactoryID","strDeviceModel","strPlateColorID","strPlateNum"],

"m_arrRecord":[["288","00012836","BP6063","13789812644","10242","深圳市全程运通物流有限公司","李茂林2","13570839135","31","2014412日到期","0","1","0","0","0","0","null","null","null","null","null","null","","1393212323","0","","null","00012836","1441326757","null","null","null","null","null","null"]]

})

4

Response Remarks

nID

table record Item

strNoticeEmail1

Owner email 1

strTEID

Device IMEI

strNoticeEmail2

Owner email2

strCarNum

Device Name

strNoticeEmail3

Owner email 3

strTESim

Device Sim

strPassword

Device Password

nTEType

Device type

nCreateTime

Create time

strGroupName

Company ID

nSwitchType

Switch type

strOwnerName

Owner name

strInfo

information

strOwnerTel

Owner tel

strOpenID

Wechat ID

strOwnerAddress

Ownder address

strDeviceID

Device ID

strRemark

remark

nLimitTime

Expire time

strIconID

Icon ID

strProvinceID

Province

nFuelBoxSize

Tank volume

strCityID

City 

nMileageInit

Initial value

strFactoryID

Factory Name

nInterval

Gprs interval

strDeviceModel

Device model

nOverSpeed

Over speed value

strPlateColorID

Plate color

nSMSNoticeState

SMS notice state

strPlateNum

Car plate

strSMSNoticeTel1

Phone number1

strSMSNoticeTel2

Phone number3

strSMSNoticeTel3

Phone number3

5

Device valid

If Request information has Requested 3 times without information Return , but Return Request succeed, it means this device is not valid at platform. Invalid device could also have past location and history report.

6

Device expire

Return string nLimitTime, expire time. If it is 0, means forever valid, if UTC time is less than current time, device expires.








 

Item

Name

Remarks

1

Request command

http://www.test.net/Interface/AppJson.asp?Cmd=Proc_GetLastPosition&Data=N'00012836'&Field=&Callback=JsonP4

2

Parameter

Proc_GetLastPosition

Request last location commandID

N'00012836'

Requested Device serial number IMEI

JsonP4

Callback function

3

Response Content

JsonP4({

"m_isResultOk":1,

"m_arrField":["nID","strTEID","nTime","dbLon","dbLat","nDirection","nSpeed","nGSMSignal","nGPSSignal","nFuel","nMileage","nTemp","nCarState","nTEState","nAlarmState","strOther"],

"m_arrRecord":[["1","00012836","1414956901","113.9392","22.5700667","198","0","0","8","0","3056919","0","-1342177280","0","0","null"]]

})

4

Response Remarks

nID

table record ID

nMileage

Step counting value

strTEID

Device serial number IMEI

nTemp

Temperature 

nTime

UTC seconds

nCarState

Car state

dbLon

Longitude

nTEState

Device sate

dbLat

Latitude

nAlarmState

Alarm state

nDirection

Direction, 0-360°C

strOther

Null

nSpeed

Speed

nGSMSignal

GSM signal

nGPSSignal

GPS signal

nFuel

Null

5

State remark

Car state, device state, alarm state. The value ia a 4-byte integer with mark, each byte has 8 bits so a integer table can represent 4*8=32 status bit. One location message can include all state and alarms. Need device if status bit has value. As bekiw,

If( nTEState & 0x80 )

{
    location invaliad… 

}

hexadecimal  table as below








  • 9. Car state:
  •  

    7th bit

    6th bit

    5th bit

    4th bit

    3rd bit

    2nd bit

    1st bit

    0 bit

    Byte1

    engine

    Job on

    Door sensor

    Job on

    shock

    Job off

    Fuel 

    disarm

    0 off/1 on

    0 off/1 on

    0 off/1 on

    0 off/1 on

    0 static/1 shock

    0 off/1 on

    0no/1 Yes

    0 off/1 on

    0x80

    0x40

    0x20

    0x10

    0x08

    0x04

    0x02

    0x01

    Byte2

    Engine on speed change

    engine off to on

    Taxi meter

    arm

    Door lock

    Heavy vehicle

    Add fuel

    Fuel abnormal

    0no/1change

    0no/1change

    0 off/1 loading

    0 off/1 on

    0 off/1 on

    0 off/1 on

    0 off/1 on

    0 off/1 on

    0x80 00

    0x40 00

    0x20 00

    0x10 00

    0x08 00

    0x04 00

    0x02 00

    0x01 00

    Byte3

    Tire temp high

    Tire pressure high

    Tire pressure low

    Tire air leak

    static

    move

    roll

    F all

    0 off/1 on

    0 off/1 on

    0 off/1 on

    0 off/1 on

    0no/1yes

    0no/1yes

    0no/1yes

    0no/1yes

    0x80 00 00

    0x40 00 00

    0x20 00 00

    0x10 00 00

    0x08 00 00

    0x04 00 00

    0x02 00 00

    0x01 00 00

    Byte4

    device off

    Device standby

    Device sleep

    Device static

    Device walking

    Device slow-run

    Device fast-run

    Device ride

    0no/1yes

    0no/1yes

    0no/1yes

    0no/1yes

    0no/1yes

    0no/1yes

    0no/1yes

    0no/1yes

    0x80 00 00 00

    0x40 00 00 00

    0x20 00 00 00

    0x10 00 00 00

    0x08 00 00 00

    0x04 00 00 00

    0x02 00 00 00

    0x01 00 00 00

  • 10. Device state:
  •  

    7th bit

    6th bit

    5th bit

    4th bit

    3rd bit

    2nd bit

    1st bit

    0 bit

    Byte1

    Location

    Gsm blind

    Gprs 

    Battery connected

    Gps blind

    GPS fault

    GPS on

    GPS off

    0 Yes/1no

    0 Yes/1 no

    0no/1yes

    0 yes/1 no

    0 Yes/1补报

    0 okay/1fault

    0 Yes/1 no

    0 on/1 off

    0x80

    0x40

    0x20

    0x10

    0x08

    0x04

    0x02

    0x01

    Byte2

    External power

    Battery power

    LBS location

    Wifi location

    Virtual location

    LCD fault

    TTS fault

    Camera fault

    0no/1yes

    0no/1yes

    0no/1yes

    0no/1yes

    0no/1yes

    0no/1yes

    0no/1yes

    0no/1yes

    0x80 00

    0x40 00

    0x20 00

    0x10 00

    0x08 00

    0x04 00

    0x02 00

    0x01 00

    Byte3

     

    3rd Byte reserved for leftover battery percentage

     

     

    0x80 00 00

    0x40 00 00

    0x20 00 00

    0x10 00 00

    0x08 00 00

    0x04 00 00

    0x02 00 00

    0x01 00 00

    Byte4

     

    4th byte reserved

     

     

    0x80 00 00 00

    0x40 00 00 00

    0x20 00 00 00

    0x10 00 00 00

    0x08 00 00 00

    0x04 00 00 00

    0x02 00 00 00

    0x01 00 00 00

  • 11. Alarm state:
  •  

    7th bit

    6th bit

    5th bit

    4th bit

    3rd bit

    2nd bit

    1st bit

    0 bit

    Byte1

    SOS

    overspeed alarm

    Fence-in alarm

    Fence-out alarm

    Power cut alarm

    Fuel cut

    Circuit cut

    collision alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 connect/ 1 disconnect

    0  connect/ 1 disconnect

    0 Y connect/ 1 disconnect

    0 Yes/1 alarm

    0x80

    0x40

    0x20

    0x10

    0x08

    0x04

    0x02

    0x01

    Byte2

    Low power alarm

    fault alarm

    emergency alarm

    information application alarm

    siren alarm

    Fatigue driving alarm

    Engine idle alarm

    tow alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0x80 00

    0x40 00

    0x20 00

    0x10 00

    0x08 00

    0x04 00

    0x02 00

    0x01 00

    Byte3

    Forbid driving alarm

    Temperature high

     alarm

    Temperature low alarm

     

    Fuel thft alarm

    Illeage Engine on alarm

     Door open alarm

    shock alarm

    Engine on alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0x80 00 00

    0x40 00 00

    0x20 00 00

    0x10 00 00

    0x08 00 00

    0x04 00 00

    0x02 00 00

    0x01 00 00

    Byte4

    custom alarm1

    custom alarm2

    custom alarm3

    Custom alarm4

    theft alarm

    arrearage alarm

    Gas leak alarm

    Parking overtime alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0 Yes/1 alarm

    0x80 00 00 00

    0x40 00 00 00

    0x20 00 00 00

    0x10 00 00 00

    0x08 00 00 00

    0x04 00 00 00

    0x02 00 00 00

    0x01 00 00 00


  • 12. Request history trace
  • Item

    Name

    Remarks

    1.  

    Request command

    http://www.test.net/Interface/AppJson.asp?Cmd=Proc_GetTrack&Data=N'00012836',N'1400999683',N'1401033599',N'5000'&Field=&Callback=JsonP5 

    1.  

    Parameter

    Proc_GetTrack

    Request history trace command

    N'00012836'

    Device serial number IMEI

    N'1400999683'

    start time, UTC seconds does not include time zone

    N'1401033599'

    Stop time, UTC seconds does not include time zone

    N'5000'

    One Request 1000 pieces at most

    JsonP5

    callback function

    1.  

    Response Content

    Return Content is multiple location data, data format is same as request device last location

  • 13. request mileage
  • Item

    Name

    Remarks

    1.  

    Request command

    http://www.test.net/Interface/AppJson.asp?Cmd=Proc_GetMileage&Data=N'00012836',N'1403712000',N'1403798399'&Field=&Callback=JsonP5

    1.  

    Parameter

    Proc_GetMileage

    Request mileage command

    N'00012836'

    Device serial number IMEI

    N'1400999683'

    start time, UTC seconds does not include time zone

    N'1401033599'

    Stop time, UTC seconds does not include time zone

    JsonP5

    callback function

    1.  

    Response Content

    JsonP5({

    "m_isResultOk":1,

    "m_arrField":["strTEID","nStartMileage","nEndMileage","nMileage"],"

    m_arrRecord":[["00012836","1947450","2028983","81533"]]

    })

    1.  

    Response Remarks

    strTEID

    Device serial number IMEI

    nStartMileage

    Start mileage, unit M

    nEndMileage

    Stop mileage, unit M

    nMileage

    Mileage travelled