Interface IMeadowCloudService
An abstraction for the Meadow.Cloud service
Assembly: Meadow.Contracts.dll
View Source
public interface IMeadowCloudService
Properties
IsEnabled
Gets the Enabled state for the service
View Source
bool IsEnabled { get; }
ConnectionState
Gets the current connection state for the service
View Source
CloudConnectionState ConnectionState { get; }
QueueCount
Gets the current number of items to be sent.
View Source
int QueueCount { get; }
Methods
SendLog(CloudLog)
Sends a log message to the Meadow.Cloud service
View Source
Task SendLog(CloudLog cloudLog)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
Meadow.Cloud.CloudLog | cloudLog | The log entry to send |
SendEvent(CloudEvent)
Sends a CloudEvent to the Meadow.Cloud service
View Source
Task SendEvent(CloudEvent cloudEvent)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
Meadow.Cloud.CloudEvent | cloudEvent |
SendEvent(int, string, Dictionary<string, object>)
Sends a CloudEvent to the Meadow.Cloud service
View Source
Task SendEvent(int eventId, string description, Dictionary<string, object> measurements)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | eventId | id used for a set of events. |
System.String | description | Description of the event. |
System.Collections.Generic.Dictionary<System.String,System.Object> | measurements | Dynamic payload of measurements to be recorded. |
SendLog(LogLevel, string)
Sends a log message to the Meadow.Cloud service
View Source
Task SendLog(LogLevel level, string message)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
Meadow.Logging.LogLevel | level | The log level for the log event |
System.String | message | The message property for the log event |
SendLog(string, string, string?)
Sends a log message to the Meadow.Cloud service
View Source
Task SendLog(string logLevel, string message, string? exceptionMessage = null)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
System.String | logLevel | The log level for the log event |
System.String | message | The message property for the log event |
System.String | exceptionMessage | Optional exception message data |
Stop()
Stops the service
View Source
void Stop()
Events
ErrorOccurred
Event raised when an error in communicating with Meadow Cloud occurrs
View Source
event EventHandler<Exception>? ErrorOccurred
Event Type
System.EventHandler<System.Exception>
ConnectionStateChanged
Event raised when the cloud connection state changes
View Source
event EventHandler<CloudConnectionState>? ConnectionStateChanged
Event Type
System.EventHandler<Meadow.CloudConnectionState>