Back to project page BLEMeshChat.
The source code is released under:
GNU General Public License
If you think the Android project BLEMeshChat listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package pro.dbro.ble.protocol; //from w w w . ja v a2 s.co m import android.support.annotation.NonNull; import android.support.annotation.Nullable; /** * Created by davidbrodsky on 10/20/14. */ public interface Protocol { /** Outgoing * * Serialize Protocol Objects to raw transmission data **/ // TODO Decide on a consistent API here public byte[] serializeIdentity(@NonNull OwnedIdentityPacket ownedIdentity); public MessagePacket serializeMessage(@NonNull OwnedIdentityPacket ownedIdentity, String body); /** Incoming * * Deserialize raw transmission data into Protocol Objects */ public IdentityPacket deserializeIdentity(@NonNull byte[] identity); /** Deserialize a message where the author identity is known */ public MessagePacket deserializeMessageWithIdentity(@NonNull byte[] message, @Nullable IdentityPacket identity); /** Deserialize a message where the author identity is not known */ public MessagePacket deserializeMessage(@NonNull byte[] message); }