您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

DeviceTransport interface

Extends
any

Methods

abandon(Message, (err?: Error, results?: MessageAbandoned) => void)
complete(Message, (err?: Error, result?: MessageCompleted) => void)
connect((err?: Error, result?: Connected) => void)
disableC2D((err?: Error) => void)
disableInputMessages((err?: Error) => void)
disableMethods((err?: Error) => void)
disableTwinDesiredPropertiesUpdates((err?: Error) => void)
disconnect((err?: Error, result?: Disconnected) => void)
enableC2D((err?: Error) => void)
enableInputMessages((err?: Error) => void)
enableMethods((err?: Error) => void)
enableTwinDesiredPropertiesUpdates((err?: Error) => void)
getTwin((err?: Error, twin?: TwinProperties) => void)
on("disconnect", (err?: Error) => void)
on("error", (err: Error) => void)
on("inputMessage", (inputName: string, msg: Message) => void)
on("message", (msg: Message) => void)
on("twinDesiredPropertiesUpdate", (desiredProps: any) => void)
onDeviceMethod(string, (request: MethodMessage, response: DeviceMethodResponse) => void)
reject(Message, (err?: Error, results?: MessageRejected) => void)
sendEvent(Message, (err?: Error, result?: MessageEnqueued) => void)
sendEventBatch(Message[], (err?: Error, result?: MessageEnqueued) => void)
sendMethodResponse(DeviceMethodResponse, (err?: Error, result?: any) => void)
sendOutputEvent(string, Message, (err?: Error, result?: MessageEnqueued) => void)
sendOutputEventBatch(string, Message[], (err?: Error, result?: MessageEnqueued) => void)
setOptions(DeviceClientOptions, (err?: Error, result?: TransportConfigured) => void)
updateSharedAccessSignature(string, (err?: Error, result?: SharedAccessSignatureUpdated) => void)
updateTwinReportedProperties(any, (err?: Error) => void)

Method Details

abandon(Message, (err?: Error, results?: MessageAbandoned) => void)

function abandon(message: Message, done: (err?: Error, results?: MessageAbandoned) => void)

Parameters

message
Message
done
(err?: Error, results?: MessageAbandoned) => void

complete(Message, (err?: Error, result?: MessageCompleted) => void)

function complete(message: Message, done: (err?: Error, result?: MessageCompleted) => void)

Parameters

message
Message
done
(err?: Error, result?: MessageCompleted) => void

connect((err?: Error, result?: Connected) => void)

function connect(done: (err?: Error, result?: Connected) => void)

Parameters

done
(err?: Error, result?: Connected) => void

disableC2D((err?: Error) => void)

function disableC2D(callback: (err?: Error) => void)

Parameters

callback
(err?: Error) => void

disableInputMessages((err?: Error) => void)

function disableInputMessages(callback: (err?: Error) => void)

Parameters

callback
(err?: Error) => void

disableMethods((err?: Error) => void)

function disableMethods(callback: (err?: Error) => void)

Parameters

callback
(err?: Error) => void

disableTwinDesiredPropertiesUpdates((err?: Error) => void)

function disableTwinDesiredPropertiesUpdates(callback: (err?: Error) => void)

Parameters

callback
(err?: Error) => void

disconnect((err?: Error, result?: Disconnected) => void)

function disconnect(done: (err?: Error, result?: Disconnected) => void)

Parameters

done
(err?: Error, result?: Disconnected) => void

enableC2D((err?: Error) => void)

function enableC2D(callback: (err?: Error) => void)

Parameters

callback
(err?: Error) => void

enableInputMessages((err?: Error) => void)

function enableInputMessages(callback: (err?: Error) => void)

Parameters

callback
(err?: Error) => void

enableMethods((err?: Error) => void)

function enableMethods(callback: (err?: Error) => void)

Parameters

callback
(err?: Error) => void

enableTwinDesiredPropertiesUpdates((err?: Error) => void)

function enableTwinDesiredPropertiesUpdates(callback: (err?: Error) => void)

Parameters

callback
(err?: Error) => void

getTwin((err?: Error, twin?: TwinProperties) => void)

function getTwin(callback: (err?: Error, twin?: TwinProperties) => void)

Parameters

callback
(err?: Error, twin?: TwinProperties) => void

on("disconnect", (err?: Error) => void)

function on(type: "disconnect", func: (err?: Error) => void)

Parameters

type
"disconnect"
func
(err?: Error) => void

Returns

this

on("error", (err: Error) => void)

function on(type: "error", func: (err: Error) => void)

Parameters

type
"error"
func
(err: Error) => void

Returns

this

on("inputMessage", (inputName: string, msg: Message) => void)

function on(type: "inputMessage", func: (inputName: string, msg: Message) => void)

Parameters

type
"inputMessage"
func
(inputName: string, msg: Message) => void

Returns

this

on("message", (msg: Message) => void)

function on(type: "message", func: (msg: Message) => void)

Parameters

type
"message"
func
(msg: Message) => void

Returns

this

on("twinDesiredPropertiesUpdate", (desiredProps: any) => void)

function on(type: "twinDesiredPropertiesUpdate", func: (desiredProps: any) => void)

Parameters

type
"twinDesiredPropertiesUpdate"
func
(desiredProps: any) => void

Returns

this

onDeviceMethod(string, (request: MethodMessage, response: DeviceMethodResponse) => void)

function onDeviceMethod(methodName: string, methodCallback: (request: MethodMessage, response: DeviceMethodResponse) => void)

Parameters

methodName
string
methodCallback
(request: MethodMessage, response: DeviceMethodResponse) => void

reject(Message, (err?: Error, results?: MessageRejected) => void)

function reject(message: Message, done: (err?: Error, results?: MessageRejected) => void)

Parameters

message
Message
done
(err?: Error, results?: MessageRejected) => void

sendEvent(Message, (err?: Error, result?: MessageEnqueued) => void)

function sendEvent(message: Message, done: (err?: Error, result?: MessageEnqueued) => void)

Parameters

message
Message
done
(err?: Error, result?: MessageEnqueued) => void

sendEventBatch(Message[], (err?: Error, result?: MessageEnqueued) => void)

function sendEventBatch(messages: Message[], done: (err?: Error, result?: MessageEnqueued) => void)

Parameters

messages
Message[]
done
(err?: Error, result?: MessageEnqueued) => void

sendMethodResponse(DeviceMethodResponse, (err?: Error, result?: any) => void)

function sendMethodResponse(response: DeviceMethodResponse, done?: (err?: Error, result?: any) => void)

Parameters

done
(err?: Error, result?: any) => void

sendOutputEvent(string, Message, (err?: Error, result?: MessageEnqueued) => void)

function sendOutputEvent(outputName: string, message: Message, done: (err?: Error, result?: MessageEnqueued) => void)

Parameters

outputName
string
message
Message
done
(err?: Error, result?: MessageEnqueued) => void

sendOutputEventBatch(string, Message[], (err?: Error, result?: MessageEnqueued) => void)

function sendOutputEventBatch(outputName: string, messages: Message[], done: (err?: Error, result?: MessageEnqueued) => void)

Parameters

outputName
string
messages
Message[]
done
(err?: Error, result?: MessageEnqueued) => void

setOptions(DeviceClientOptions, (err?: Error, result?: TransportConfigured) => void)

function setOptions(options: DeviceClientOptions, done: (err?: Error, result?: TransportConfigured) => void)

Parameters

done
(err?: Error, result?: TransportConfigured) => void

updateSharedAccessSignature(string, (err?: Error, result?: SharedAccessSignatureUpdated) => void)

function updateSharedAccessSignature(sharedAccessSignature: string, done: (err?: Error, result?: SharedAccessSignatureUpdated) => void)

Parameters

sharedAccessSignature
string
done
(err?: Error, result?: SharedAccessSignatureUpdated) => void

updateTwinReportedProperties(any, (err?: Error) => void)

function updateTwinReportedProperties(patch: any, callback: (err?: Error) => void)

Parameters

patch
any
callback
(err?: Error) => void