// Path: sdk/src/main/java/com/punchthrough/bean/sdk/message/BeanError.java
// public enum BeanError {
// 
//     GATT_SERIAL_TRANSPORT_ERROR,
// 
//     /**
//      * Bean is not connected
//      */
//     NOT_CONNECTED,
// 
//     /**
//      * Bean's services have not yet been discovered
//      */
//     SERVICES_NOT_DISCOVERED,
// 
//     /**
//      * OAD service was not found
//      */
//     MISSING_OAD_SERVICE,
// 
//     /**
//      * OAD Identify characteristic was not found
//      */
//     MISSING_OAD_IDENTIFY,
// 
//     /**
//      * OAD Block characteristic was not found
//      */
//     MISSING_OAD_BLOCK,
// 
//     /**
//      * Notifications could not be enabled for either OAD Identify, Block, or both characteristics
//      */
//     ENABLE_OAD_NOTIFY_FAILED,
// 
//     /**
//      * Timed out during sketch programming, before sending blocks: Bean took too long to update its
//      * current state
//      */
//     STATE_TIMEOUT,
// 
//     /**
//      * Firmware version to send could not be parsed from OAD request header
//      */
//     UNPARSABLE_FW_VERSION,
// 
//     /**
//      * Timed out during OAD
//      */
//     OAD_TIMEOUT,
// 
//     /**
//      * Bean rejected firmware version for being older than the current version
//      */
//     BEAN_REJECTED_FW,
// 
//     /**
//      * The client (user) rejected the OAD process
//      */
//     CLIENT_REJECTED,
// 
//     /**
//      * Bean responded with a message with an ID we don't know anything about
//      */
//     UNKNOWN_MESSAGE_ID,
// 
//     /**
//      * Bean did not provide a reason for the error
//      */
//     UNKNOWN
// 
// }
// 
// Path: sdk/src/main/java/com/punchthrough/bean/sdk/message/ScratchBank.java
// public enum ScratchBank implements EnumParse.ParsableEnum {
//     BANK_1(1), BANK_2(2), BANK_3(3), BANK_4(4), BANK_5(5);
// 
//     private final int value;
// 
//     private ScratchBank(final int value) {
//         this.value = value;
//     }
// 
//     public int getRawValue() {
//         return value;
//     }
// }


import com.punchthrough.bean.sdk.message.BeanError;
import com.punchthrough.bean.sdk.message.ScratchBank;
/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2014 Little Robots
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package com.punchthrough.bean.sdk;


/**
 * A Listener interface for communicating with the Bean.
 */
public interface BeanListener {

    /**
     * Called when the Bean is connected. Connected means that a Bluetooth GATT connection is made
     * and the setup for the Bean serial protocol is complete.
     */
    public void onConnected();

    /**
     * Called when the connection could not be established. This could either be because the Bean
     * could not be connected, or the serial connection could not be established.
     */
    public void onConnectionFailed();

    /**
     * Called when the Bean has been disconnected.
     */
    public void onDisconnected();

    /**
     * Called when a serial message is received from the Bean, e.g. a <code>Serial.write()</code>
     * from Arduino code.
     *
     * @param data the data that was sent from th bean
     */
    public void onSerialMessageReceived(byte[] data);

    /**
     * Called when one of the scratch characteristics of the Bean has updated its value.
     *
     * @param bank  the {@link com.punchthrough.bean.sdk.message.ScratchBank} that was updated
     * @param value the bank's new value
     */
// Path: sdk/src/main/java/com/punchthrough/bean/sdk/message/BeanError.java
// public enum BeanError {
// 
//     GATT_SERIAL_TRANSPORT_ERROR,
// 
//     /**
//      * Bean is not connected
//      */
//     NOT_CONNECTED,
// 
//     /**
//      * Bean's services have not yet been discovered
//      */
//     SERVICES_NOT_DISCOVERED,
// 
//     /**
//      * OAD service was not found
//      */
//     MISSING_OAD_SERVICE,
// 
//     /**
//      * OAD Identify characteristic was not found
//      */
//     MISSING_OAD_IDENTIFY,
// 
//     /**
//      * OAD Block characteristic was not found
//      */
//     MISSING_OAD_BLOCK,
// 
//     /**
//      * Notifications could not be enabled for either OAD Identify, Block, or both characteristics
//      */
//     ENABLE_OAD_NOTIFY_FAILED,
// 
//     /**
//      * Timed out during sketch programming, before sending blocks: Bean took too long to update its
//      * current state
//      */
//     STATE_TIMEOUT,
// 
//     /**
//      * Firmware version to send could not be parsed from OAD request header
//      */
//     UNPARSABLE_FW_VERSION,
// 
//     /**
//      * Timed out during OAD
//      */
//     OAD_TIMEOUT,
// 
//     /**
//      * Bean rejected firmware version for being older than the current version
//      */
//     BEAN_REJECTED_FW,
// 
//     /**
//      * The client (user) rejected the OAD process
//      */
//     CLIENT_REJECTED,
// 
//     /**
//      * Bean responded with a message with an ID we don't know anything about
//      */
//     UNKNOWN_MESSAGE_ID,
// 
//     /**
//      * Bean did not provide a reason for the error
//      */
//     UNKNOWN
// 
// }
// 
// Path: sdk/src/main/java/com/punchthrough/bean/sdk/message/ScratchBank.java
// public enum ScratchBank implements EnumParse.ParsableEnum {
//     BANK_1(1), BANK_2(2), BANK_3(3), BANK_4(4), BANK_5(5);
// 
//     private final int value;
// 
//     private ScratchBank(final int value) {
//         this.value = value;
//     }
// 
//     public int getRawValue() {
//         return value;
//     }
// }


// Path: sdk/src/main/java/com/punchthrough/bean/sdk/BeanListener.java
import com.punchthrough.bean.sdk.message.BeanError;
import com.punchthrough.bean.sdk.message.ScratchBank;

/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2014 Little Robots
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package com.punchthrough.bean.sdk;


/**
 * A Listener interface for communicating with the Bean.
 */
public interface BeanListener {

    /**
     * Called when the Bean is connected. Connected means that a Bluetooth GATT connection is made
     * and the setup for the Bean serial protocol is complete.
     */
    public void onConnected();

    /**
     * Called when the connection could not be established. This could either be because the Bean
     * could not be connected, or the serial connection could not be established.
     */
    public void onConnectionFailed();

    /**
     * Called when the Bean has been disconnected.
     */
    public void onDisconnected();

    /**
     * Called when a serial message is received from the Bean, e.g. a <code>Serial.write()</code>
     * from Arduino code.
     *
     * @param data the data that was sent from th bean
     */
    public void onSerialMessageReceived(byte[] data);

    /**
     * Called when one of the scratch characteristics of the Bean has updated its value.
     *
     * @param bank  the {@link com.punchthrough.bean.sdk.message.ScratchBank} that was updated
     * @param value the bank's new value
     */
    public void onScratchValueChanged(ScratchBank bank, byte[] value);