// Path: src/main/java/com/bortbort/arduino/FiloFirmata/DigitalPinValue.java
// public enum DigitalPinValue {
//     LOW    (0x00), // Digital Low
//     HIGH   (0x01); // Digital High
// 
//     private Byte byteValue;
//     private Integer intValue;
// 
//     DigitalPinValue(int byteValue) {
//         this.byteValue = (byte) byteValue;
//         intValue = byteValue;
//     }
// 
//     /**
//      * Get Byte Value.
//      * @return Byte representing the digital logic pin value.
//      */
//     public Byte getByteValue() {
//         return byteValue;
//     }
// 
//     /**
//      * Get Integer Value.
//      * @return Integer representing the digital logic pin value.
//      */
//     public Integer getIntValue() {
//         return intValue;
//     }
// 
//     /**
//      * Translate to DigitalPinValue from a supplied Integer.
//      * @param pinValue Integer representing the digital value.
//      * @return DigitalPinValue representing the integer (High/Low).
//      */
//     public static DigitalPinValue valueFromInt(Integer pinValue) {
//         return pinValue <= 0 ? LOW : HIGH;
//     }
// 
//     /**
//     * Translate to DigitalPinValue from a supplied Byte.
//     * @param byteValue Byte representing the digital value.
//     * @return DigitalPinValue representing the byte (High/Low).
//     */
//     public static DigitalPinValue valueFromByte(Byte byteValue) {
//         return valueFromInt((int) byteValue);
//     }
// }


import com.bortbort.arduino.FiloFirmata.DigitalPinValue;
import java.util.HashMap;
package com.bortbort.arduino.FiloFirmata.Messages;



/**
 * Digital Port Channel Message
 * Holds details on the pin that the message is for, as well as a map of Firmata pins and their read in
 * digital logic level.
 * Firmata Digital Port communicates up 8 device pins per message, based on channel
 * Channel 0 is pins 0-7. Channel 1 is pines 8-15.
 */
public class DigitalPortMessage extends ChannelMessage {
    private HashMap<Integer, Integer> pinValues;
    private HashMap<Integer, DigitalPinValue> digitalPinValues;
    private Byte portByte;

    public DigitalPortMessage(byte channelPort, HashMap<Integer, Integer> pinValues,
                              HashMap<Integer, DigitalPinValue> digitalPinValues, Byte portByte) {
        super(channelPort);
        this.pinValues = pinValues;
        this.digitalPinValues = digitalPinValues;
        this.portByte = portByte;
    }

    /**
     * Get Digital Pin Values
     * The keys will be 0-7 for channel 1, 8-15 for channel 2, 16-23 for channel 3.
     * @return HashMap containing a map of all pin identifiers and their DigitalPinValue (High/Low)
     */
// Path: src/main/java/com/bortbort/arduino/FiloFirmata/DigitalPinValue.java
// public enum DigitalPinValue {
//     LOW    (0x00), // Digital Low
//     HIGH   (0x01); // Digital High
// 
//     private Byte byteValue;
//     private Integer intValue;
// 
//     DigitalPinValue(int byteValue) {
//         this.byteValue = (byte) byteValue;
//         intValue = byteValue;
//     }
// 
//     /**
//      * Get Byte Value.
//      * @return Byte representing the digital logic pin value.
//      */
//     public Byte getByteValue() {
//         return byteValue;
//     }
// 
//     /**
//      * Get Integer Value.
//      * @return Integer representing the digital logic pin value.
//      */
//     public Integer getIntValue() {
//         return intValue;
//     }
// 
//     /**
//      * Translate to DigitalPinValue from a supplied Integer.
//      * @param pinValue Integer representing the digital value.
//      * @return DigitalPinValue representing the integer (High/Low).
//      */
//     public static DigitalPinValue valueFromInt(Integer pinValue) {
//         return pinValue <= 0 ? LOW : HIGH;
//     }
// 
//     /**
//     * Translate to DigitalPinValue from a supplied Byte.
//     * @param byteValue Byte representing the digital value.
//     * @return DigitalPinValue representing the byte (High/Low).
//     */
//     public static DigitalPinValue valueFromByte(Byte byteValue) {
//         return valueFromInt((int) byteValue);
//     }
// }


// Path: src/main/java/com/bortbort/arduino/FiloFirmata/Messages/DigitalPortMessage.java
import com.bortbort.arduino.FiloFirmata.DigitalPinValue;
import java.util.HashMap;

package com.bortbort.arduino.FiloFirmata.Messages;



/**
 * Digital Port Channel Message
 * Holds details on the pin that the message is for, as well as a map of Firmata pins and their read in
 * digital logic level.
 * Firmata Digital Port communicates up 8 device pins per message, based on channel
 * Channel 0 is pins 0-7. Channel 1 is pines 8-15.
 */
public class DigitalPortMessage extends ChannelMessage {
    private HashMap<Integer, Integer> pinValues;
    private HashMap<Integer, DigitalPinValue> digitalPinValues;
    private Byte portByte;

    public DigitalPortMessage(byte channelPort, HashMap<Integer, Integer> pinValues,
                              HashMap<Integer, DigitalPinValue> digitalPinValues, Byte portByte) {
        super(channelPort);
        this.pinValues = pinValues;
        this.digitalPinValues = digitalPinValues;
        this.portByte = portByte;
    }

    /**
     * Get Digital Pin Values
     * The keys will be 0-7 for channel 1, 8-15 for channel 2, 16-23 for channel 3.
     * @return HashMap containing a map of all pin identifiers and their DigitalPinValue (High/Low)
     */
    public HashMap<Integer, DigitalPinValue> getDigitalPinValues() {