Package com.github.lucadruda.iotc.device
Interface IIoTCClient
- All Known Implementing Classes:
IoTCClient
public interface IIoTCClient
-
Method Summary
Modifier and TypeMethodDescriptionvoidConnect()Connect the devicevoidConnect the devicevoidDisconnect device.voidbooleanvoidon(IOTC_EVENTS eventName, IoTCCallback callback)voidSendProperty(Object payload)voidSendProperty(String payload)voidSendTelemetry(Object payload)voidSendTelemetry(Object payload, Object properties)voidSendTelemetry(Object payload, String properties)voidSendTelemetry(String payload)voidSendTelemetry(String payload, Object properties)voidSendTelemetry(String payload, String properties)voidSetGlobalEndpoint(String endpoint)Set global endpoint for DPS provisioningvoidSetLogging(IOTC_LOGGING loggingLevel)voidSetModelId(String modelId)voidSetProtocol(IOTC_PROTOCOL transport)booleanUploadFile(String fileName, File file)booleanUploadFile(String fileName, File file, String encoding)
-
Method Details
-
SetModelId
- Parameters:
modelId- IoT Central model Id for automatic approval process
-
SetGlobalEndpoint
Set global endpoint for DPS provisioning- Parameters:
endpoint- hostname without protocol
-
Disconnect
Disconnect device. Client cannot be reused after disconnect!!!- Throws:
IoTCentralException- If disconnection fails
-
Connect
Connect the device- Throws:
IoTCentralException- If connection fails
-
Connect
Connect the device- Parameters:
timeout- Timeout in seconds before forcing connection stop- Throws:
IoTCentralException- If connection fails
-
SendTelemetry
- Parameters:
payload- Message to send: can be any type (usually json) or a collection of messages- Throws:
IoTCentralException- If telemetry delivery failed
-
SendTelemetry
- Parameters:
payload- Message to send: can be any type (usually json) or a collection of messages- Throws:
IoTCentralException- If telemetry delivery failed
-
SendTelemetry
- Parameters:
payload- Message to send: can be any type (usually json) or a collection of messagesproperties- Properties to be added to the message (JSON format)- Throws:
IoTCentralException- If telemetry delivery failed
-
SendTelemetry
- Parameters:
payload- Message to send: can be any type (usually json) or a collection of messagesproperties- Properties to be added to the message (JSON format)- Throws:
IoTCentralException- If telemetry delivery failed
-
SendTelemetry
- Parameters:
payload- Message to send: can be any type (usually json) or a collection of messagesproperties- Properties to be added to the message (JSON format)- Throws:
IoTCentralException- If telemetry delivery failed
-
SendTelemetry
- Parameters:
payload- Message to send: can be any type (usually json) or a collection of messagesproperties- Properties to be added to the message (JSON format)- Throws:
IoTCentralException- If telemetry delivery failed
-
SendProperty
- Parameters:
payload- Property to send: can be any type (usually json) or a collection of properties- Throws:
IoTCentralException- If property delivery fails
-
SendProperty
- Parameters:
payload- Property to send: can be any type (usually json) or a collection of properties- Throws:
IoTCentralException- If property delivery fails
-
SetProtocol
-
on
- Parameters:
eventName- name of the event to listencallback- function to execute when event triggers
-
SetLogging
-
IsConnected
boolean IsConnected() -
FetchTwin
- Throws:
IoTCentralException
-
UploadFile
- Throws:
IoTCentralException
-
UploadFile
- Throws:
IoTCentralException
-