Interfaces for most of MAKO IoT components. Start building your app here :)
See Mako-IoT.Device
IDevice, IDeviceBuilder, IDeviceStartBehavior
See Mako-IoT.Device.Services.Configuration
IConfigurationService
ICommunicationService abstracts data transport logic. Currently MAKO-IoT provides MQTT implementation.
//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;
//[...]
}
See Mako-IoT.Device.Services.DataProviders
IDataProvider
See Mako-IoT.Device.Services.Messaging
IMessageBus, IConsumer, ConsumeContext, ConsumeStrategy
INetworkProvider provides basic network connectivity functions. Currently MAKO-IoT provides WiFi implementation.
if (!_networkProvider.IsConnected)
{
_networkProvider.Connect();
if (!_networkProvider.IsConnected)
throw new NotConnectedException("Could not connect to network");
}
See Mako-IoT.Device.Services.Scheduler
IScheduler, ITask
IStorageService provides persistent storage functions. Currently MAKO-IoT provides NVS Flash storage implementation.
bool fileExists = _storage.FileExists(fileName);
//read file
contents = _storage.ReadFile(fileName);
//write to file
_storage.WriteToFile(fileName, contents);
//delete file
_storage.DeleteFile(file);