Package com.github.lucadruda.iotc.device
Interface IIoTCClient
- All Known Implementing Classes:
IoTCClient
public interface IIoTCClient
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Connect()
Connect the devicevoid
Connect the devicevoid
Disconnect device.void
boolean
void
on(IOTC_EVENTS eventName, IoTCCallback callback)
void
SendProperty(Object payload)
void
SendProperty(String payload)
void
SendTelemetry(Object payload)
void
SendTelemetry(Object payload, Object properties)
void
SendTelemetry(Object payload, String properties)
void
SendTelemetry(String payload)
void
SendTelemetry(String payload, Object properties)
void
SendTelemetry(String payload, String properties)
void
SetGlobalEndpoint(String endpoint)
Set global endpoint for DPS provisioningvoid
SetLogging(IOTC_LOGGING loggingLevel)
void
SetModelId(String modelId)
void
SetProtocol(IOTC_PROTOCOL transport)
boolean
UploadFile(String fileName, File file)
boolean
UploadFile(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
-