59 lines
1.7 KiB
C#
59 lines
1.7 KiB
C#
/*
|
|
M2Mqtt - MQTT Client Library for .Net
|
|
Copyright (c) 2014, Paolo Patierno, All rights reserved.
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Lesser General Public
|
|
License as published by the Free Software Foundation; either
|
|
version 3.0 of the License, or (at your option) any later version.
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
License along with this library.
|
|
*/
|
|
|
|
using System;
|
|
using System.Text;
|
|
|
|
namespace uPLibrary.Networking.M2Mqtt
|
|
{
|
|
/// <summary>
|
|
/// Interface for channel under MQTT library
|
|
/// </summary>
|
|
public interface IMqttNetworkChannel
|
|
{
|
|
/// <summary>
|
|
/// Data available on channel
|
|
/// </summary>
|
|
bool DataAvailable { get; }
|
|
|
|
/// <summary>
|
|
/// Receive data from the network channel
|
|
/// </summary>
|
|
/// <param name="buffer">Data buffer for receiving data</param>
|
|
/// <returns>Number of bytes received</returns>
|
|
int Receive(byte[] buffer);
|
|
|
|
/// <summary>
|
|
/// Send data on the network channel to the broker
|
|
/// </summary>
|
|
/// <param name="buffer">Data buffer to send</param>
|
|
/// <returns>Number of byte sent</returns>
|
|
int Send(byte[] buffer);
|
|
|
|
/// <summary>
|
|
/// Close the network channel
|
|
/// </summary>
|
|
void Close();
|
|
|
|
/// <summary>
|
|
/// Connect to remote server
|
|
/// </summary>
|
|
void Connect();
|
|
}
|
|
}
|