Skip to content

CShark-Hub/Mako-IoT.Device.Services.Interface

Repository files navigation

Mako-IoT.Device.Services.Interface

Interfaces for most of MAKO IoT components. Start building your app here :)

Device

See Mako-IoT.Device

IDevice, IDeviceBuilder, IDeviceStartBehavior

Configuration

See Mako-IoT.Device.Services.Configuration

IConfigurationService

Communication

ICommunicationService abstracts data transport logic. Currently MAKO-IoT provides MQTT implementation.

Example

//attach message received handler
_communicationService.MessageReceived += OnMessageReceived;

_communicationService.Connect(topicsToSubscribe);

//publish message
_communicationService.Publish(message, topic);

//send message to recipient
_communicationService.Send(message, recipient);

_communicationService.Disconnect();

internal void OnMessageReceived(object sender, EventArgs e)
{
  var message = (string)((ObjectEventArgs)e).Data;
  //[...]
}

Data Providers

See Mako-IoT.Device.Services.DataProviders

IDataProvider

Message Bus

See Mako-IoT.Device.Services.Messaging

IMessageBus, IConsumer, ConsumeContext, ConsumeStrategy

Networking

INetworkProvider provides basic network connectivity functions. Currently MAKO-IoT provides WiFi implementation.

Example

if (!_networkProvider.IsConnected)
{
    _networkProvider.Connect();
    if (!_networkProvider.IsConnected)
        throw new NotConnectedException("Could not connect to network");
}

Scheduler

See Mako-IoT.Device.Services.Scheduler

IScheduler, ITask

Storage

IStorageService provides persistent storage functions. Currently MAKO-IoT provides NVS Flash storage implementation.

Example

bool fileExists = _storage.FileExists(fileName);

//read file
contents = _storage.ReadFile(fileName);

//write to file
_storage.WriteToFile(fileName, contents);

//delete file
_storage.DeleteFile(file);

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages