Documentation

Mistake on this page? Email us
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
MbedCloudSDK.Connect.Api.ConnectApi Class Reference

Connect Api More...

Inheritance diagram for MbedCloudSDK.Connect.Api.ConnectApi:
MbedCloudSDK.Common.Api

Public Member Functions

PaginatedResponse< QueryOptions, ConnectedDeviceListConnectedDevices (QueryOptions options=null)
 Lists all connected devices. More...
 
IEnumerable< string > ListDeviceSubscriptions (string deviceId)
 List a device's resources with subscriptions More...
 
void DeleteDeviceSubscriptions (string deviceId)
 Removes a device's subscriptions More...
 
IEnumerable< Model.Resource.ResourceListResources (string deviceId)
 List Resources. More...
 
Model.Resource.Resource GetResource (string deviceId, string resourcePath)
 Get a resource from the path More...
 
string ExecuteResource (string deviceId, string resourcePath, string functionName=null, int?timeout=null)
 Execute a function on a resource More...
 
async Task< AsyncConsumer< string > > ExecuteResourceAsync (string deviceId, string resourcePath, string functionName=null)
 Execute a function on a resource asynchronously More...
 
string GetResourceValue (string deviceId, string resourcePath, int?timeout=null)
 Gets the value of the resource.. More...
 
async Task< AsyncConsumer< string > > GetResourceValueAsync (string deviceId, string resourcePath)
 Gets the value of the resource asynchronously More...
 
string SetResourceValue (string deviceId, string resourcePath, string resourceValue, int?timeout=null)
 Sets the value for the specified resource. More...
 
async Task< AsyncConsumer< string > > SetResourceValueAsync (string deviceId, string resourcePath, string resourceValue)
 Sets the value for the specified string resource. More...
 
async Task< AsyncConsumer< string > > SetResourceValueAsync (string deviceId, string resourcePath, long resourceValue)
 Sets the value for the specified 64 bit signed integer resource. More...
 
async Task< AsyncConsumer< string > > SetResourceValueAsync (string deviceId, string resourcePath, int resourceValue)
 Sets the value for the specified 32 bit signed integer resource. More...
 
async Task< AsyncConsumer< string > > SetResourceValueAsync (string deviceId, string resourcePath, short resourceValue)
 Sets the value for the specified 16 bit signed integer resource. More...
 
async Task< AsyncConsumer< string > > SetResourceValueAsync (string deviceId, string resourcePath, byte[] resourceValue)
 Sets the value for the specified binary resource. More...
 
string ExecuteResource (string deviceId, string resourcePath, string functionName, bool?noResp)
 Obsolote, do not use. More...
 
Task< AsyncConsumer< string > > ExecuteResourceAsync (string deviceId, string resourcePath, string functionName, bool?noResp)
 Obsolote, do not use. More...
 
string GetResourceValue (string deviceId, string resourcePath, bool?noResp)
 Obsolote, do not use. More...
 
Task< AsyncConsumer< string > > GetResourceValueAsync (string deviceId, string resourcePath, bool?noResp)
 Obsolote, do not use. More...
 
string SetResourceValue (string deviceId, string resourcePath, string resourceValue, bool?noResp)
 Obsolote, do not use. More...
 
Task< AsyncConsumer< string > > SetResourceValueAsync (string deviceId, string resourcePath, string resourceValue, bool?noResp)
 Obsolote, do not use. More...
 
 ConnectApi (ConnectApiConfig config)
 Initializes a new instance of the ConnectApi class. More...
 
 ConnectApi (Config config)
 Initializes a new instance of the ConnectApi class. More...
 
void Dispose ()
 Dispose More...
 
void Notify (NotificationMessage notification)
 Notify More...
 
void Notify (string notification)
 Notify More...
 
void StartNotifications ()
 Starts the notifications. More...
 
async Task StartNotificationsAsync ()
 Starts the notifications task. More...
 
void StopNotifications ()
 Stops the notifications. More...
 
async Task StopNotificationsAsync ()
 Stops the notifications task. More...
 
void UpdatePresubscriptions (Presubscription[] presubscriptions)
 Update pre-subscription data. Pre-subscription data will be removed for empty list. More...
 
Presubscription[] ListPresubscriptions ()
 Get a list of pre-subscription data. More...
 
void DeletePresubscriptions ()
 Delete the presubscriptions More...
 
void DeleteSubscriptions ()
 Remove all subscriptions More...
 
async Task< ResourceAddResourceSubscriptionAsync (string deviceId, string resourcePath)
 Subscribe to resource updates. More...
 
Resource AddResourceSubscription (string deviceId, string resourcePath)
 Obsolote, do not use. More...
 
bool GetResourceSubscription (string deviceId, string resourcePath)
 Gets the status of a resource's subscription. True if ok, false if not. More...
 
void DeleteResourceSubscription (string deviceId, string resourcePath)
 Unsubscribe from device and/or resource_path updates. More...
 
PaginatedResponse< MetricQueryOptions, MetricListMetrics (MetricQueryOptions options=null)
 Get Metrics. More...
 
Webhook GetWebhook ()
 Get the current callback URL if it exists. More...
 
async Task UpdateWebhookAsync (Webhook webhook)
 Register new webhook for incoming subscriptions. More...
 
void UpdateWebhook (Webhook webhook)
 Obsolote, do not use. More...
 
void DeleteWebhook ()
 Delete/remove registered webhook. More...
 

Static Public Member Functions

static ApiMetadata GetLastApiMetadata ()
 Get meta data for the last Pelion Device Management API call More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Virtual dispose More...
 
virtual void ThrowIfDisposed ()
 Throw if disposed More...
 
virtual void NotifyCore (NotificationMessage notification)
 Notifies the core. More...
 
- Protected Member Functions inherited from MbedCloudSDK.Common.Api
 Api (Config config)
 Initializes a new instance of the Api class. More...
 

Properties

ConcurrentDictionary< string, AsyncCollection< string > > AsyncResponses [get]
 Gets async responses More...
 
NotificationDeliveryMethod.DeliveryMethod DeliveryMethod = new ConcurrentDictionary<string, AsyncCollection<string>>() [get]
 Gets the delivery method. More...
 
ConcurrentDictionary< string, AsyncCollection< string > > NotificationQueue [get]
 Gets NotificationQueue More...
 
ConcurrentDictionary< string, ResourceResourceSubscribtions = new ConcurrentDictionary<string, AsyncCollection<string>>() [get]
 Gets resource Subscriptions More...
 
MbedCloudSDK.Connect.Api.Subscribe.Subscribe Subscribe = new ConcurrentDictionary<string, Resource>() [get, set]
 Gets or sets the SubscribeManager More...
 
bool IsClosing [get, set]
 Gets or sets a value indicating whether this instance is closing. More...
 
bool NotificationsStarted [get, set]
 Gets or sets a value indicating whether [notifications started]. More...
 
- Properties inherited from MbedCloudSDK.Common.Api
static string UserAgent [get, set]
 Gets or sets the user agent. More...
 
Config Config [get]
 Gets config More...
 

Additional Inherited Members

- Static Protected Attributes inherited from MbedCloudSDK.Common.Api
static readonly ILog Log = LogManager.GetLogger(typeof(Api))
 The log More...
 

Detailed Description

Connect Api

Connect Api

This API is intialized with a Config object.

var config = new config(apiKey);
var connectApi = new ConnectApi(config);

Some methods require a notification channel to be set up before they will work.

connectApi.StartNotifications();
var resource = connectApi.GetResourceValue("", "5001/0/1");
connectApi.StopNotifications();

Constructor & Destructor Documentation

MbedCloudSDK.Connect.Api.ConnectApi.ConnectApi ( ConnectApiConfig  config)
inline

Initializes a new instance of the ConnectApi class.

Parameters
configConfig
MbedCloudSDK.Connect.Api.ConnectApi.ConnectApi ( Config  config)
inline

Initializes a new instance of the ConnectApi class.

Parameters
configConfig

Member Function Documentation

Resource MbedCloudSDK.Connect.Api.ConnectApi.AddResourceSubscription ( string  deviceId,
string  resourcePath 
)
inline

Obsolote, do not use.

Parameters
deviceIdtodo: describe deviceId parameter on AddResourceSubscription
resourcePathtodo: describe resourcePath parameter on AddResourceSubscription
Returns
Resource
async Task<Resource> MbedCloudSDK.Connect.Api.ConnectApi.AddResourceSubscriptionAsync ( string  deviceId,
string  resourcePath 
)
inline

Subscribe to resource updates.

Parameters
deviceIdId of device.
resourcePathResource path.
Returns
Async Consumer with String
var consumer = await api.AddResourceSubscriptionAsync("015bb66a92a30000000000010010006d", "3200/0/5500");
var counter = 0;
while (true)
{
var t = consumer.GetValue();
Console.WriteLine(t.Result);
counter++;
if (counter >= 2)
{
break;
}
}
Exceptions
CloudApiExceptionCloudApiException
void MbedCloudSDK.Connect.Api.ConnectApi.DeleteDeviceSubscriptions ( string  deviceId)
inline

Removes a device's subscriptions

Parameters
deviceIdDevice Id
try
{
connectApi.DeleteDeviceSubscriptions("015bb66a92a30000000000010010006d");
}
catch (CloudApiException)
{
throw;
}
Exceptions
CloudApiExceptionCloudApiException
void MbedCloudSDK.Connect.Api.ConnectApi.DeletePresubscriptions ( )
inline

Delete the presubscriptions

try
{
connectApi.DeletePresubscriptions();
}
catch (MbedCloudApiException)
{
throw;
}
Exceptions
CloudApiExceptionCloudApiException
void MbedCloudSDK.Connect.Api.ConnectApi.DeleteResourceSubscription ( string  deviceId,
string  resourcePath 
)
inline

Unsubscribe from device and/or resource_path updates.

Parameters
deviceIddevice to unsubscribe events from.
resourcePathresource_path to unsubscribe events from.
try
{
connectApi.DeleteResourceSubscription("015bb66a92a30000000000010010006d", "3200/0/5500");
}
catch (CloudApiException)
{
throw;
}
Exceptions
CloudApiExceptionCloudApiException
void MbedCloudSDK.Connect.Api.ConnectApi.DeleteSubscriptions ( )
inline

Remove all subscriptions

Warning: This could be slow for large numbers of connected devices. If possible, explicitly delete subscriptions known to have been created.

try
{
connectApi.DeleteSubscriptions();
}
catch (CloudApiException)
{
throw;
}
Exceptions
CloudApiExceptionCloudApiException
void MbedCloudSDK.Connect.Api.ConnectApi.DeleteWebhook ( )
inline

Delete/remove registered webhook.

try
{
connectApi.DeleteWebhook();
}
catch (CloudApiException)
{
throw;
}
Exceptions
CloudApiExceptionCloudApiException
void MbedCloudSDK.Connect.Api.ConnectApi.Dispose ( )
inline

Dispose

virtual void MbedCloudSDK.Connect.Api.ConnectApi.Dispose ( bool  disposing)
inlineprotectedvirtual

Virtual dispose

Parameters
disposingdispose
string MbedCloudSDK.Connect.Api.ConnectApi.ExecuteResource ( string  deviceId,
string  resourcePath,
string  functionName = null,
int?  timeout = null 
)

Execute a function on a resource

Parameters
deviceIdDevice ID
resourcePathResource path
functionNameThe function to trigger
timeoutThe async request will timeout after given number of milliseconds
Returns
AsyncConsumer with response
try
{
var resp = connectApi.ExecuteResource("015bb66a92a30000000000010010006d", "5001/0/1");
Console.WriteLine(resp);
}
catch (CloudApiException)
{
throw;
}
Exceptions
ArgumentNullExceptionIf deviceId is .
-or-
If resourcePath is .
ArgumentExceptionIf deviceId is a blank or empty string.
-or-
If resourcePath is a blank or empty string.
CloudApiExceptionIf an error occurred while communicating with the server or if the server responsed with an error.
string MbedCloudSDK.Connect.Api.ConnectApi.ExecuteResource ( string  deviceId,
string  resourcePath,
string  functionName,
bool?  noResp 
)

Obsolote, do not use.

async Task<AsyncConsumer<string> > MbedCloudSDK.Connect.Api.ConnectApi.ExecuteResourceAsync ( string  deviceId,
string  resourcePath,
string  functionName = null 
)
inline

Execute a function on a resource asynchronously

Parameters
deviceIdDevice Id
resourcePathResource path.
functionNameThe function to trigger
Returns
Async consumer with string
Exceptions
ArgumentNullExceptionIf deviceId is .
-or-
If resourcePath is .
ArgumentExceptionIf deviceId is a blank or empty string.
-or-
If resourcePath is a blank or empty string.
CloudApiExceptionIf an error occurred while communicating with the server or if the server responsed with an error.
Task<AsyncConsumer<string> > MbedCloudSDK.Connect.Api.ConnectApi.ExecuteResourceAsync ( string  deviceId,
string  resourcePath,
string  functionName,
bool?  noResp 
)

Obsolote, do not use.

static ApiMetadata MbedCloudSDK.Connect.Api.ConnectApi.GetLastApiMetadata ( )
inlinestatic

Get meta data for the last Pelion Device Management API call

Returns
ApiMetadata
Model.Resource.Resource MbedCloudSDK.Connect.Api.ConnectApi.GetResource ( string  deviceId,
string  resourcePath 
)
inline

Get a resource from the path

Parameters
deviceIdId of the device
resourcePathPath to the resource
Returns
The resource at the givn path
try
{
var resource = connectApi.GetResource("015bb66a92a30000000000010010006d", "5001/0/1");
return resource;
}
catch (CloudApiException)
{
throw;
}
Exceptions
CloudApiExceptionCloudApiException
bool MbedCloudSDK.Connect.Api.ConnectApi.GetResourceSubscription ( string  deviceId,
string  resourcePath 
)
inline

Gets the status of a resource's subscription. True if ok, false if not.

Parameters
deviceIdId of device.
resourcePathResource path.
Returns
True if subscribed, false if not.
var status = connectApi.GetResourceSubscription("015bb66a92a30000000000010010006d", "3200/0/5500");
string MbedCloudSDK.Connect.Api.ConnectApi.GetResourceValue ( string  deviceId,
string  resourcePath,
int?  timeout = null 
)

Gets the value of the resource..

Parameters
deviceIdDevice Id
resourcePathResource path.
timeoutThe async request will timeout after given number of milliseconds
Returns
Resourse Value
try
{
var resp = connectApi.GetResourceValue("015bb66a92a30000000000010010006d", "5001/0/1");
Console.WriteLine($"The value of the resource is {resp}");
}
catch (CloudApiException)
{
throw;
}
Exceptions
ArgumentNullExceptionIf deviceId is .
-or-
If resourcePath is .
ArgumentExceptionIf deviceId is a blank or empty string.
-or-
If resourcePath is a blank or empty string.
CloudApiExceptionIf an error occurred while communicating with the server or if the server responsed with an error.
string MbedCloudSDK.Connect.Api.ConnectApi.GetResourceValue ( string  deviceId,
string  resourcePath,
bool?  noResp 
)

Obsolote, do not use.

async Task<AsyncConsumer<string> > MbedCloudSDK.Connect.Api.ConnectApi.GetResourceValueAsync ( string  deviceId,
string  resourcePath 
)
inline

Gets the value of the resource asynchronously

Parameters
deviceIdDevice Id
resourcePathResource path.
Returns
Async consumer with string
Exceptions
ArgumentNullExceptionIf deviceId is .
-or-
If resourcePath is .
ArgumentExceptionIf deviceId is a blank or empty string.
-or-
If resourcePath is a blank or empty string.
CloudApiExceptionIf an error occurred while communicating with the server or if the server responsed with an error.
Task<AsyncConsumer<string> > MbedCloudSDK.Connect.Api.ConnectApi.GetResourceValueAsync ( string  deviceId,
string  resourcePath,
bool?  noResp 
)

Obsolote, do not use.

Webhook MbedCloudSDK.Connect.Api.ConnectApi.GetWebhook ( )
inline

Get the current callback URL if it exists.

Returns
Webhook
try
{
var webhook = connectApi.GetWebhook();
return webhook;
}
catch (CloudApiException)
{
throw;
}
Exceptions
CloudApiExceptionCloudApiException
PaginatedResponse<QueryOptions, ConnectedDevice> MbedCloudSDK.Connect.Api.ConnectApi.ListConnectedDevices ( QueryOptions  options = null)
inline

Lists all connected devices.

Parameters
optionsQueryOptions
Returns
The list of connected devices.
Exceptions
CloudApiExceptionCloudApiException
try
{
var options = new QueryOptions();
options.Filter.Add("createdAt", new DateTime(2017, 1, 1), FilterOperator.GreaterOrEqual);
options.Filter.Add("createdAt", new DateTime(2018, 1, 1), FilterOperator.LessOrEqual);
var devices = connectApi.ListConnectedDevices(options);
foreach (var item in devices)
{
Console.WriteLine(item);
}
}
catch (CloudApiException)
{
throw;
}
IEnumerable<string> MbedCloudSDK.Connect.Api.ConnectApi.ListDeviceSubscriptions ( string  deviceId)
inline

List a device's resources with subscriptions

Parameters
deviceIdDeviceId
Returns
List of device subscriptions
try
{
var subscriptions = connectApi.ListDeviceSubscriptions("015bb66a92a30000000000010010006d");
foreach (var resource in subscriptions)
{
Console.WriteLine(resource);
}
return subscriptions;
}
catch (CloudApiException)
{
throw;
}
Exceptions
CloudApiExceptionCloudApiException
PaginatedResponse<MetricQueryOptions, Metric> MbedCloudSDK.Connect.Api.ConnectApi.ListMetrics ( MetricQueryOptions  options = null)
inline

Get Metrics.

Parameters
optionsQuery options.
Returns
List of statistics data queried using options.
Exceptions
CloudApiExceptionCloudApiException

This sample shows how to call the ListMetrics method.

try
{
var options = new MetricQueryOptions()
{
Interval = "1d",
Period = "30d",
};
var metricsData = api.ListMetrics(options);
foreach(var data in metricsData)
{
Console.WriteLine(data);
}
}
catch (CloudApiException) {
throw;
}
Presubscription [] MbedCloudSDK.Connect.Api.ConnectApi.ListPresubscriptions ( )
inline

Get a list of pre-subscription data.

Returns
List of Presubscription
try
{
var presubscriptions = connectApi.ListPresubscriptions();
foreach (var item in presubscriptions)
{
Console.WriteLine(item);
}
return presubscriptions;
}
catch (MbedCloudApiException)
{
throw;
}
Exceptions
CloudApiExceptionCloudApiException
IEnumerable<Model.Resource.Resource> MbedCloudSDK.Connect.Api.ConnectApi.ListResources ( string  deviceId)
inline

List Resources.

Parameters
deviceIdId of the device that this resource belongs to.
Returns
List of resources for this endpoint.
try
{
var resources = connectApi.ListResources("015bb66a92a30000000000010010006d");
foreach (var resource in resources)
{
Console.WriteLine(resource);
}
return resources;
}
catch (CloudApiException)
{
throw;
}
Exceptions
CloudApiExceptionCloudApiException
void MbedCloudSDK.Connect.Api.ConnectApi.Notify ( NotificationMessage  notification)
inline

Notify

Parameters
notificationThe Notification Message as a NotificationMessage
void MbedCloudSDK.Connect.Api.ConnectApi.Notify ( string  notification)
inline

Notify

Parameters
notificationThe Notification Message as a string.
virtual void MbedCloudSDK.Connect.Api.ConnectApi.NotifyCore ( NotificationMessage  notification)
inlineprotectedvirtual

Notifies the core.

Parameters
notificationThe notification.
string MbedCloudSDK.Connect.Api.ConnectApi.SetResourceValue ( string  deviceId,
string  resourcePath,
string  resourceValue,
int?  timeout = null 
)

Sets the value for the specified resource.

Parameters
deviceIdID of the device which contains the resource.
resourcePathFull path of the resource to write.
resourceValueThe new value for the specified resource, sent as an UTF-8 encoded stream.
timeoutThe async request will timeout after given number of milliseconds
Returns
The ID of the asynchronous request.
Exceptions
ArgumentNullExceptionIf deviceId is .
-or-
If resourcePath is .
-or-
If resourceValue is .
ArgumentExceptionIf deviceId is a blank or empty string.
-or-
If resourcePath is a blank or empty string.
CloudApiExceptionIf an error occurred while communicating with the server or if the server responsed with an error.
string MbedCloudSDK.Connect.Api.ConnectApi.SetResourceValue ( string  deviceId,
string  resourcePath,
string  resourceValue,
bool?  noResp 
)

Obsolote, do not use.

async Task<AsyncConsumer<string> > MbedCloudSDK.Connect.Api.ConnectApi.SetResourceValueAsync ( string  deviceId,
string  resourcePath,
string  resourceValue 
)
inline

Sets the value for the specified string resource.

<overloads> Sets the value for the specified resource. </overloads>

Parameters
deviceIdID of the device which contains the resource.
resourcePathFull path of the resource to write.
resourceValueThe new value for the specified resource, sent as an UTF-8 encoded stream.
Returns
The ID of the asynchronous request.
try
{
var resp = connectApi.SetResourceValue("015bb66a92a30000000000010010006d", "5001/0/1", "new value");
var newValue = connectApi.GetResourceValue("015bb66a92a30000000000010010006d", "5001/0/1");
Console.WriteLine($"The value of the resource is {newValue}");
}
catch (CloudApiException)
{
throw;
}
Exceptions
ArgumentNullExceptionIf deviceId is .
-or-
If resourcePath is .
-or-
If resourceValue is .
ArgumentExceptionIf deviceId is a blank or empty string.
-or-
If resourcePath is a blank or empty string.
CloudApiExceptionIf an error occurred while communicating with the server or if the server responsed with an error.
async Task<AsyncConsumer<string> > MbedCloudSDK.Connect.Api.ConnectApi.SetResourceValueAsync ( string  deviceId,
string  resourcePath,
long  resourceValue 
)
inline

Sets the value for the specified 64 bit signed integer resource.

Parameters
deviceIdID of the device which contains the resource.
resourcePathFull path of the resource to write.
resourceValueThe new value for the specified resource, sent as big endian byte array.
Returns
The ID of the asynchronous request.
Exceptions
ArgumentNullExceptionIf deviceId is .
-or-
If resourcePath is .
ArgumentExceptionIf deviceId is a blank or empty string.
-or-
If resourcePath is a blank or empty string.
CloudApiExceptionIf an error occurred while communicating with the server or if the server responsed with an error.
async Task<AsyncConsumer<string> > MbedCloudSDK.Connect.Api.ConnectApi.SetResourceValueAsync ( string  deviceId,
string  resourcePath,
int  resourceValue 
)
inline

Sets the value for the specified 32 bit signed integer resource.

Parameters
deviceIdID of the device which contains the resource.
resourcePathFull path of the resource to write.
resourceValueThe new value for the specified resource, sent as big endian byte array.
Returns
The ID of the asynchronous request.
Exceptions
ArgumentNullExceptionIf deviceId is .
-or-
If resourcePath is .
ArgumentExceptionIf deviceId is a blank or empty string.
-or-
If resourcePath is a blank or empty string.
CloudApiExceptionIf an error occurred while communicating with the server or if the server responsed with an error.
async Task<AsyncConsumer<string> > MbedCloudSDK.Connect.Api.ConnectApi.SetResourceValueAsync ( string  deviceId,
string  resourcePath,
short  resourceValue 
)
inline

Sets the value for the specified 16 bit signed integer resource.

Parameters
deviceIdID of the device which contains the resource.
resourcePathFull path of the resource to write.
resourceValueThe new value for the specified resource, sent as big endian byte array.
Returns
The ID of the asynchronous request.
Exceptions
ArgumentNullExceptionIf deviceId is .
-or-
If resourcePath is .
-or-
If resourceValue is .
ArgumentExceptionIf deviceId is a blank or empty string.
CloudApiExceptionIf an error occurred while communicating with the server or if the server responsed with an error.
async Task<AsyncConsumer<string> > MbedCloudSDK.Connect.Api.ConnectApi.SetResourceValueAsync ( string  deviceId,
string  resourcePath,
byte[]  resourceValue 
)
inline

Sets the value for the specified binary resource.

Parameters
deviceIdID of the device which contains the resource.
resourcePathFull path of the resource to write.
resourceValueThe new value for the specified resource.
Returns
The ID of the asynchronous request.
Exceptions
ArgumentNullExceptionIf deviceId is .
-or-
If resourcePath is .
-or-
If resourceValue is .
ArgumentExceptionIf deviceId is a blank or empty string.
-or-
If resourcePath is a blank or empty string.
CloudApiExceptionIf an error occurred while communicating with the server or if the server responsed with an error.
Task<AsyncConsumer<string> > MbedCloudSDK.Connect.Api.ConnectApi.SetResourceValueAsync ( string  deviceId,
string  resourcePath,
string  resourceValue,
bool?  noResp 
)

Obsolote, do not use.

void MbedCloudSDK.Connect.Api.ConnectApi.StartNotifications ( )
inline

Starts the notifications.

async Task MbedCloudSDK.Connect.Api.ConnectApi.StartNotificationsAsync ( )
inline

Starts the notifications task.

try
{
connectApi.StartNotifications();
}
catch (Exception)
{
throw;
}
Returns
A Task representing the asynchronous operation.
void MbedCloudSDK.Connect.Api.ConnectApi.StopNotifications ( )
inline

Stops the notifications.

async Task MbedCloudSDK.Connect.Api.ConnectApi.StopNotificationsAsync ( )
inline

Stops the notifications task.

{
connectApi.StopNotifications();
}
catch (Exception)
{
throw;
}
Returns
A Task representing the asynchronous operation.
virtual void MbedCloudSDK.Connect.Api.ConnectApi.ThrowIfDisposed ( )
inlineprotectedvirtual

Throw if disposed

void MbedCloudSDK.Connect.Api.ConnectApi.UpdatePresubscriptions ( Presubscription[]  presubscriptions)
inline

Update pre-subscription data. Pre-subscription data will be removed for empty list.

Parameters
presubscriptionsArray of Presubscription
try
{
var presubscription = new Presubscription
{
DeviceId = "015bb66a92a30000000000010010006d",
ResourcePaths = new List { "/5001/0/1" },
};
connectApi.UpdatePresubscriptions(new Presubscription[] { presubscription });
foreach (var item in api.ListPresubscriptions())
{
Console.WriteLine(item);
}
}
catch (MbedCloudApiException)
{
throw;
}
Exceptions
CloudApiExceptionCloudApiException
void MbedCloudSDK.Connect.Api.ConnectApi.UpdateWebhook ( Webhook  webhook)
inline

Obsolote, do not use.

Parameters
webhooktodo: describe webhook parameter on UpdateWebhook
async Task MbedCloudSDK.Connect.Api.ConnectApi.UpdateWebhookAsync ( Webhook  webhook)
inline

Register new webhook for incoming subscriptions.

Parameters
webhookWebhook
try
{
var webhook = new Webhook
{
Url = "www.exampleurl.com",
};
connectApi.UpdateWebhook(webhook);
}
catch (CloudApiException)
{
throw;
}
Exceptions
CloudApiExceptionCloudApiException
Returns
A Task representing the asynchronous operation.

Property Documentation

ConcurrentDictionary<string, AsyncCollection<string> > MbedCloudSDK.Connect.Api.ConnectApi.AsyncResponses
get

Gets async responses

NotificationDeliveryMethod.DeliveryMethod MbedCloudSDK.Connect.Api.ConnectApi.DeliveryMethod = new ConcurrentDictionary<string, AsyncCollection<string>>()
get

Gets the delivery method.

The delivery method.

bool MbedCloudSDK.Connect.Api.ConnectApi.IsClosing
getset

Gets or sets a value indicating whether this instance is closing.

true if this instance is closing; otherwise, false.

ConcurrentDictionary<string, AsyncCollection<string> > MbedCloudSDK.Connect.Api.ConnectApi.NotificationQueue
get

Gets NotificationQueue

bool MbedCloudSDK.Connect.Api.ConnectApi.NotificationsStarted
getset

Gets or sets a value indicating whether [notifications started].

true if [notifications started]; otherwise, false.

ConcurrentDictionary<string, Resource> MbedCloudSDK.Connect.Api.ConnectApi.ResourceSubscribtions = new ConcurrentDictionary<string, AsyncCollection<string>>()
get

Gets resource Subscriptions

MbedCloudSDK.Connect.Api.Subscribe.Subscribe MbedCloudSDK.Connect.Api.ConnectApi.Subscribe = new ConcurrentDictionary<string, Resource>()
getset

Gets or sets the SubscribeManager


The documentation for this class was generated from the following files: