Skip to main content

Interface IMeadowCloudService

An abstraction for the Meadow.Cloud service

Assembly: Meadow.Contracts.dll
View Source
Declaration
public interface IMeadowCloudService

Properties

IsEnabled

Gets the Enabled state for the service

View Source
Declaration
bool IsEnabled { get; }

ConnectionState

Gets the current connection state for the service

View Source
Declaration
CloudConnectionState ConnectionState { get; }

QueueCount

Gets the current number of items to be sent.

View Source
Declaration
int QueueCount { get; }

Methods

SendLog(CloudLog)

Sends a log message to the Meadow.Cloud service

View Source
Declaration
Task SendLog(CloudLog cloudLog)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
Meadow.Cloud.CloudLogcloudLogThe log entry to send

SendEvent(CloudEvent)

Sends a CloudEvent to the Meadow.Cloud service

View Source
Declaration
Task SendEvent(CloudEvent cloudEvent)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
Meadow.Cloud.CloudEventcloudEvent

SendEvent(int, string, Dictionary<string, object>)

Sends a CloudEvent to the Meadow.Cloud service

View Source
Declaration
Task SendEvent(int eventId, string description, Dictionary<string, object> measurements)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.Int32eventIdid used for a set of events.
System.StringdescriptionDescription of the event.
System.Collections.Generic.Dictionary<System.String,System.Object>measurementsDynamic payload of measurements to be recorded.

SendLog(LogLevel, string)

Sends a log message to the Meadow.Cloud service

View Source
Declaration
Task SendLog(LogLevel level, string message)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
Meadow.Logging.LogLevellevelThe log level for the log event
System.StringmessageThe message property for the log event

SendLog(string, string, string?)

Sends a log message to the Meadow.Cloud service

View Source
Declaration
Task SendLog(string logLevel, string message, string? exceptionMessage = null)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.StringlogLevelThe log level for the log event
System.StringmessageThe message property for the log event
System.StringexceptionMessageOptional exception message data

Stop()

Stops the service

View Source
Declaration
void Stop()

Events

ErrorOccurred

Event raised when an error in communicating with Meadow Cloud occurrs

View Source
Declaration
event EventHandler<Exception>? ErrorOccurred
Event Type

System.EventHandler<System.Exception>

ConnectionStateChanged

Event raised when the cloud connection state changes

View Source
Declaration
event EventHandler<CloudConnectionState>? ConnectionStateChanged
Event Type

System.EventHandler<Meadow.CloudConnectionState>