PSDK Function

2023-09-18
No Rating

Event

psdk-report ui resource package uploading result

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: psdk_ui_resource_upload_result

Data:

ColumnNameTypeconstraintDescription
psdk_indexpsdk payload device indexint{"min":0,"max":3,"step":1}
object_keyoss objecttext
sizeFile sizeint{"unit":"Byte / B"}
resultReturn Codeint

Example:

{
	"method": "psdk_ui_resource_upload_result",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"timestamp": 1689911315621,
	"gateway": "4TADKAQ000002J",
	"data": {
		"object_key": "f4a4a171-bb33-45d6-bd3d-b10034f66734/1581F5BLD22BE00A090U_2023_07_21_11_48_33_widget",
		"psdk_index": 2,
		"result": 0,
		"size": 43488
	}
}

psdk-push floating window text

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: psdk_floating_window_text

Data:

ColumnNameTypeconstraintDescription
psdk_indexpsdk payload device indexint{"min":0,"max":3,"step":1}
valuefloating window contenttext

Example:

{
	"method": "psdk_floating_window_text",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"timestamp": 1689911744380,
	"gateway": "4TADKAQ000002J",
	"data": {
		"psdk_index": 2,
		"value": "System time : 1193683 ms"
	}
}

Speaker-audio playing progress notification

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: speaker_audio_play_start_progress

Data:

ColumnNameTypeconstraintDescription
resultReturn Codeint
outputOutputstruct
»psdk_indexpsdk payload device indexint{"min":0}
»statusCurrent stateenum_string{"in_progress":"Processing","ok":"Successfully play"}
»md5MD5 checksum of file content, used as a unique identifier for the airport.text
»progressProgressstruct
»»percentProgress percentageint{"max":"100","min":"0","step":"1","unit":"percent / %"}
»»step_keyCurrent stepenum_string{"change_work_mode":"Switch working mode","download":"Download audio from cloud to dock","encoding":"Decode pcm to opus","upload":"Dock upload audio to psdk","play":"Start playing"}

Example:

{
	"method": "speaker_audio_play_start_progress",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"timestamp": 1689868551258,
	"gateway": "4TADKAQ000002J",
	"data": {
		"output": {
			"md5": "e0ecd29bb44d9e08107aaccecdc6cae2",
			"progress": {
				"percent": 89,
				"step_key": "upload"
			},
			"psdk_index": 2,
			"status": "in_progress"
		},
		"result": 0
	}
}

Speaker-tts playing progress notification

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: speaker_tts_play_start_progress

Data:

ColumnNameTypeconstraintDescription
resultReturn Codeint
outputOutputstruct
»psdk_indexpsdk payload device indexint{"min":0}
»statusCurrent stateenum_string{"in_progress":"Processing","ok":"Successfully play"}
»md5MD5 checksum of file content, used as a unique identifier for the airport.text
»progressProgressstruct
»»percentProgress percentageint{"max":"100","min":"0","step":"1","unit":"percent / %"}
»»step_keyCurrent stepenum_string{"change_work_mode":"Switch working mode","upload":"Dock upload audio to psdk","play":"Start playing"}

Example:

{
	"method": "speaker_tts_play_start_progress",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"timestamp": 1689911352309,
	"gateway": "4TADKAQ000002J",
	"data": {
		"output": {
			"md5": "bacee8ed225fa346f6da87f67c914728",
			"progress": {
				"percent": 100,
				"step_key": "play"
			},
			"psdk_index": 2,
			"status": "success"
		},
		"result": 0
	}
}

Service

psdk-set widget value

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: psdk_widget_value_set

Data:

ColumnNameTypeconstraintDescription
psdk_indexpsdk payload device indexint{"min":0}
indexWidget indexint{"min":0,"step":1}
valueWidget valueint{}Custom defined widget value. For example, switch, progress.

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"timestamp": 1689740550047,
	"method": "psdk_widget_value_set",
	"data": {
		"psdk_index": 2,
		"index": 1,
		"value": 60
	}
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: psdk_widget_value_set

Data:

ColumnNameTypeconstraintDescription
resultReturn Codeint

Example:

{
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"data": {
		"result": 0
	}
}

psdk-send text box content

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: psdk_input_box_text_set

Data:

ColumnNameTypeconstraintDescription
psdk_indexpsdk payload device indexint{"min":0}
valuetext contenttext{"length":128,"unit":"Byte / B"}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"timestamp": 1689740550047,
	"method": "psdk_input_box_text_set",
	"data": {
		"psdk_index": 2,
		"value": "hello world"
	}
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: psdk_input_box_text_set

Data:

ColumnNameTypeconstraintDescription
resultReturn Codeint

Example:

{
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"data": {
		"result": 0
	}
}

Speaker-start play audio

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: speaker_audio_play_start

Data:

ColumnNameTypeconstraintDescription
psdk_indexpsdk payload device indexint{"min":0}
fileAudio filestruct
»nameFile nametext{}
»urlFile downloading addresstext{}
»md5MD5 checksum of file content, used as a unique identifier for the airport.text
»formatSpeaker input file formatenum_string{"pcm":"pcm format"}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"timestamp": 1689912303287,
	"method": "speaker_audio_play_start",
	"data": {
		"file": {
			"format": "pcm",
			"md5": "b38257017001f45ec064b5157b2e4416",
			"name": "20230720162718",
			"url": "https://example.com/5a6f9d4b-2a38-4b4b-86f9-3a678da0bf4a/3dd27366-bf21-41a7-9f07-62b74f2e93a7/fe2f2474-720a-4122-a552-010e1ed08920/20230720162718.webm.pcm"
		},
		"psdk_index": 2
	}
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: speaker_audio_play_start

Data:

ColumnNameTypeconstraintDescription
resultReturn Codeint

Example:

{
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"data": {
		"result": 0
	}
}

Speaker-start play TTS text

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: speaker_tts_play_start

Data:

ColumnNameTypeconstraintDescription
psdk_indexpsdk payload device indexint{"min":0}
ttstts textstruct
»nameFile nametext{}
»textText contenttext{}
»md5MD5 checksum of file content, used as a unique identifier for the airport.text

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"timestamp": 1689860575397,
	"method": "speaker_tts_play_start",
	"data": {
		"psdk_index": 2,
		"tts": {
			"md5": "0bfb9bceee974f41a6ddfd81521bd795",
			"name": "1111",
			"text": "1111"
		}
	}
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: speaker_tts_play_start

Data:

ColumnNameTypeconstraintDescription
resultReturn Codeint

Example:

{
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"data": {
		"result": 0
	}
}

Speaker-replay

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: speaker_replay

Data:

ColumnNameTypeconstraintDescription
psdk_indexpsdk payload device indexint{"min":0}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"timestamp": 1689748764875,
	"method": "speaker_replay",
	"data": {
		"psdk_index": 2
	}
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: speaker_replay

Data:

ColumnNameTypeconstraintDescription
resultReturn Codeint

Example:

{
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"data": {
		"result": 0
	}
}

Speaker-stop play

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: speaker_play_stop

Data:

ColumnNameTypeconstraintDescription
psdk_indexpsdk payload device indexint{"min":0}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"timestamp": 1689748815503,
	"method": "speaker_play_stop",
	"data": {
		"psdk_index": 2
	}
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: speaker_play_stop

Data:

ColumnNameTypeconstraintDescription
resultReturn Codeint

Example:

{
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"data": {
		"result": 0
	}
}

Speaker-set play mode

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: speaker_play_mode_set

Data:

ColumnNameTypeconstraintDescription
psdk_indexpsdk payload device indexint{"min":0,"max":3,"step":1}
play_modespeaker play modeenum_int{"0":"Single play","1":"Circle play (one song)"}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"timestamp": 1689842974113,
	"method": "speaker_play_mode_set",
	"data": {
		"play_mode": 1,
		"psdk_index": 2
	}
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: speaker_play_mode_set

Data:

ColumnNameTypeconstraintDescription
resultReturn Codeint

Example:

{
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"data": {
		"result": 0
	}
}

Speaker-set volume

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: speaker_play_volume_set

Data:

ColumnNameTypeconstraintDescription
psdk_indexpsdk payload device indexint{"min":0,"max":3,"step":1}
play_volumeSpeaker volumeint{"min":0,"max":100,"step":1}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"timestamp": 1689842989237,
	"method": "speaker_play_volume_set",
	"data": {
		"play_volume": 13,
		"psdk_index": 2
	}
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: speaker_play_volume_set

Data:

ColumnNameTypeconstraintDescription
resultReturn Codeint

Example:

{
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"data": {
		"result": 0
	}
}

Requests

Obtain upload temporary credentials

Topic: thing/product/{gateway_sn}/requests

Direction: up

Method: storage_config_get

Data:

ColumnNameTypeconstraintDescription
moduleModule enumeration valueenum_int{"0":"media","1":"psdk ui resource"}

Example:

{
	"method": "storage_config_get",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"timestamp": 1689911314560,
	"gateway": "4TADKAQ000002J",
	"data": {
		"module": 1
	}
}

Topic: thing/product/{gateway_sn}/requests_reply

Direction: down

Method: storage_config_get

Data:

ColumnNameTypeconstraintDescription
bucketName of object storage buckettext
credentialsCredentials informationstruct
»access_key_idAccess key IDtext
»access_key_secretAccess key secrettext
»expireExpired time of access key secretint{"step":"1","unit":"second / s"}
»security_tokensession credentialstext
endpointAccess domain name for external servicestext
providerCloud vendor enumeration valueenum_string{"ali":"Ali Cloud","aws":"Amazon Cloud","minio":"minio"}
regionRegion of data centertext
object_key_prefixKey prefix of object storage buckettext

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"data": {
		"output": {
			"bucket": "bucket_name",
			"credentials": {
				"access_key_id": "access_key_id",
				"access_key_secret": "access_key_secret",
				"expire": 3600,
				"security_token": "security_token"
			},
			"endpoint": "https://oss-cn-hangzhou.aliyuncs.com",
			"object_key_prefix": "b4cfaae6-bd9d-4cd0-8472-63b608c3c581",
			"provider": "ali",
			"region": "hz"
		},
		"result": 0
	},
	"timestamp:": 1654070968655
}
If you have any comments or confusion about our documentation, you can click here to give feedback and we will get back to you as soon as possible.