/* Copyright (c) 2013, 2014 Paolo Patierno All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 and Eclipse Distribution License v1.0 which accompany this distribution. The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License is available at http://www.eclipse.org/org/documents/edl-v10.php. Contributors: Paolo Patierno - initial API and implementation and/or initial documentation */ using System; using System.Text; namespace uPLibrary.Networking.M2Mqtt { /// /// Interface for channel under MQTT library /// public interface IMqttNetworkChannel { /// /// Data available on channel /// bool DataAvailable { get; } /// /// Receive data from the network channel /// /// Data buffer for receiving data /// Number of bytes received int Receive(byte[] buffer); /// /// Receive data from the network channel with a specified timeout /// /// Data buffer for receiving data /// Timeout on receiving (in milliseconds) /// Number of bytes received int Receive(byte[] buffer, int timeout); /// /// Send data on the network channel to the broker /// /// Data buffer to send /// Number of byte sent int Send(byte[] buffer); /// /// Close the network channel /// void Close(); /// /// Connect to remote server /// void Connect(); /// /// Accept client connection /// void Accept(); } }