Drivers: create, edit, delete

To create, edit or delete driver, use the command resource/update_driver:

svc=resource/update_driver&params={"itemId":<long>,
				  "id":<long>,
				  "callMode":<text>,
				  "c":<text>,
				  "ck":<short>,
				  "ds":<text>,
				  "n":<text>,
				  "p":<text>,
				  "r":<double>,
				  "f":<uint>,
				  "jp":{
				    	<text>:<text>,
				    	...
				  }}

Parameters

Name Description
itemId resource ID
id driver ID
callMode action: create, update, delete
Parameters required only for create and update:
c code
ck check sum of driver image
ds description
n name
p phone number like +1234567890 (+ must be encoded as %2B)
r aspect ratio of driver image
f flags: not used at this moment
jp custom fields in the format name: value

Response

On create and edit:

[
	<long>,			/* driver ID */
	{
		"id":<long>,		/* driver ID */
		"n":<text>,		/* name */
		"c":<text>,		/* code */
		"jp": {			/* custom fields */
			<text>:<text>,		/* name: value */
			...
		},
		"ds":<text>,		/* description */
		"p":<text>,		/* phone number */
		"r":<double>,		/* aspect ratio of driver image */
		"ck":<ushort>,		/* check sum of driver image */
		"bu":<long>,		/* bound unit */
		"pu":<long>,		/* previous bound unit */
		"bt":<uint>,		/* time of last binding/unbinding */
		"pos":{			/* position */	
			"y":<double>,		/* latitude */	
			"x":<double>		/* longitude */
		}		
	}
]

On delete:

[
	<long>,		/* driver ID */
	null
]
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon info@gurtam.com   |   Copyright © 2002-2024 Gurtam