public interface IIoTCClient
| Modifier and Type | Method and Description |
|---|---|
void |
Connect()
Connect device.
|
void |
Disconnect(IoTCCallback callback)
Disconnect device.
|
void |
on(IOTC_EVENTS event,
IoTCCallback callback)
Listen to events.
|
void |
SendEvent(Object payload,
IoTCCallback callback)
Send events
|
void |
SendProperty(Object payload,
IoTCCallback callback)
Send update values to properties.
|
void |
SendState(Object payload,
IoTCCallback callback)
Send a state message
|
void |
SendTelemetry(Object payload,
IoTCCallback callback)
Send a telemetry message.
|
void |
SetGlobalEndpoint(String endpoint)
Set DPS global endpoint.
|
void |
SetLogging(IOTC_LOGGING logLevel)
Set logging level (FULL, API_ONLY, DISABLED).
|
void |
SetProtocol(IOTC_PROTOCOL transport)
Set connection protocol (MQTT, AMQP, HTTPS).
|
void |
SetProxy(HTTP_PROXY_OPTIONS options)
Set network proxy Must be called before Connect().
|
void SetProtocol(IOTC_PROTOCOL transport)
transport - Trasport to set. Default: MQTTvoid SetGlobalEndpoint(String endpoint)
endpoint - Endpoint of DPS server. Default:
"global.azure-devices-provisioning.net"void SetProxy(HTTP_PROXY_OPTIONS options)
options - Proxy optionsvoid SetLogging(IOTC_LOGGING logLevel)
logLevel - The logging level. Default: DISABLEDvoid Disconnect(IoTCCallback callback) throws IoTCentralException
callback - Callback executing when device successfully disconnect.IoTCentralException - if disconnection failsvoid Connect()
throws IoTCentralException
IoTCentralException - if connection failsvoid SendTelemetry(Object payload, IoTCCallback callback) throws IoTCentralException
payload - The telemetry object. Can include multiple values in a
flatten object. It can be a map, a POJO or a JSON stringcallback - The callback to execute when message is delivered to the hubIoTCentralException - if connection is droppedvoid SendState(Object payload, IoTCCallback callback) throws IoTCentralException
payload - The state object. Can include multiple values in a flatten
object. It can be a map, a POJO or a JSON stringcallback - The callback to execute when message is delivered to the hubIoTCentralException - if connection is droppedvoid SendEvent(Object payload, IoTCCallback callback) throws IoTCentralException
payload - The event object. Can include multiple events in a flatten
object. It can be a map, a POJO or a JSON stringcallback - The callback to execute when message is delivered to the hubIoTCentralException - if connection is droppedvoid SendProperty(Object payload, IoTCCallback callback) throws IoTCentralException
payload - The property object. Can include multiple values in a flatten
object. It can be a map, a POJO or a JSON string. If property
is sent in the form {propertyName:{value:"value"}} and
propertyName is the name of a command, then it sends updates
to specific command tile in IoTCentral( e.g. command
progress)callback - The callback to execute when message is delivered to the hubIoTCentralException - if connection is droppedvoid on(IOTC_EVENTS event, IoTCCallback callback)
event - The event to listen to.callback - The callback to execute when the event is triggeredCopyright © 2019. All rights reserved.