@@ -0,0 +1,1700 @@
+package info.izumin.android.bletia.event;%0A%0Aimport android.os.Bundle;%0Aimport android.os.Message;%0A%0Aimport org.jdeferred.Deferred;%0Aimport org.jdeferred.impl.DeferredObject;%0A%0Aimport java.util.UUID;%0A%0Aimport info.izumin.android.bletia.BletiaException;%0Aimport info.izumin.android.bletia.wrapper.BluetoothGattWrapper;%0A%0A/**%0A * Created by izumin on 9/15/15.%0A */%0Apublic abstract class Event%3CT%3E %7B%0A    public enum Type %7B%0A        WRITE_CHARACTERISTIC(1),%0A        READ_CHARACTERISTIC(2),%0A        WRITE_DESCRIPTOR(3),%0A        READ_DESCRIPTOR(4),%0A        ENABLE_NOTIFICATION(5),%0A        READ_REMOTE_RSSI(6);%0A%0A        private final int mCode;%0A%0A        Type(int code) %7B%0A            mCode = code;%0A        %7D%0A%0A        public int getCode() %7B%0A            return mCode;%0A        %7D%0A%0A        public static Type valueOf(int code) %7B%0A            for (Type type : values()) %7B%0A                if (type.getCode() == code) %7B return type; %7D%0A            %7D%0A            throw new IllegalArgumentException();%0A        %7D%0A    %7D%0A%0A    public static final String KEY_UUID = %22key_uuid%22;%0A%0A    private final Deferred%3CT, BletiaException, Object%3E mDeferred;%0A%0A    public Event() %7B%0A        mDeferred = new DeferredObject%3C%3E();%0A    %7D%0A%0A    public Deferred%3CT, BletiaException, Object%3E getDeferred() %7B%0A        return mDeferred;%0A    %7D%0A%0A    public UUID getUuid() %7B%0A        return null;%0A    %7D%0A%0A    public Message obtainMessage() %7B%0A        Message message = Message.obtain();%0A        message.what = getType().getCode();%0A        message.setData(getBundle());%0A        return message;%0A    %7D%0A%0A    public Bundle getBundle() %7B%0A        return new Bundle();%0A    %7D%0A%0A    public abstract Type getType();%0A    public abstract void handle(BluetoothGattWrapper gattWrapper);%0A%7D%0A

Add new Event class