// Path: core/src/net/jazdw/jnacan/CanFilter.java
// @Data
// public class CanFilter {
//     CanId id;
//     CanId mask;
//     
//     public CanFilter(int id, int mask) {
//         this(new CanId(id), new CanId(mask));
//     }
//     
//     public CanFilter(CanId id, int mask) {
//         this(id, new CanId(mask));
//     }
//     
//     public CanFilter(CanId id, CanId mask) {
//         this.id = id;
//         this.mask = mask;
//     }
//     
//     /**
//      * Inverts the operation of this filter
//      */
//     public void setInverted() {
//         id.setInverted();
//     }
//     
//     /**
//      * Clears the inversion of this filter
//      */
//     public void clearInverted() {
//         id.clearInverted();
//     }
//     
//     /**
//      * @return true if filter is inverted
//      */
//     public boolean isInverted() {
//         return id.isInverted();
//     }
//     
//     public can_filter toJnaType() {
//         return new can_filter(id.getId(), mask.getId());
//     }
//     
//     public void copyTo(can_filter filter) {
//         filter.can_id = id.getId();
//         filter.can_mask = mask.getId();
//     }
// }


import net.jazdw.jnacan.CanFilter;
import io.netty.buffer.ByteBufAllocator;
import io.netty.channel.ChannelConfig;
import io.netty.channel.MessageSizeEstimator;
import io.netty.channel.RecvByteBufAllocator;
/*
 * Copyright (C) 2014 Jared Wiltshire. All rights reserved.
 * @author Jared Wiltshire
 */

package net.jazdw.jnacan.netty;


/**
 * Copyright (C) 2014 Jared Wiltshire. All rights reserved.
 * @author Jared Wiltshire
 */
public interface CanChannelConfig extends ChannelConfig {
    /**
     * @return true if time-stamping is enabled
     */
    boolean isTimestampEnabled();
    
    /**
     * Sets if the socket should time-stamp frames
     * @param timestamp
     * @return
     */
    CanChannelConfig setTimestampEnabled(boolean timestamp);

    /**
     * @return true if loop-back enabled
     */
    boolean isLoopback();
    
    /**
     * Sets the loop-back behavior
     * @param loopback
     * @return
     */
    CanChannelConfig setLoopback(boolean loopback);

    /**
     * @return true if socket receives its own messages
     */
    boolean isRecvOwnMsgs();
    
    /**
     * Sets the receive own messages behavior
     * @param recvOwnMsgs
     * @return
     */
    CanChannelConfig setRecvOwnMsgs(boolean recvOwnMsgs);

    /**
     * @return the CAN interface filters
     */
    CanFilter[] getFilters();
    
    /**
     * Sets the CAN interface filters
     * @param filters
     * @return
     */
    CanChannelConfig setFilters(CanFilter... filters);

    /**
     * @return the can interface error filter
     */
    int getErrorFilter();
    
    /**
     * Sets the can interface error filter
     * @param errorFilter
     * @return
     */
// Path: core/src/net/jazdw/jnacan/CanFilter.java
// @Data
// public class CanFilter {
//     CanId id;
//     CanId mask;
//     
//     public CanFilter(int id, int mask) {
//         this(new CanId(id), new CanId(mask));
//     }
//     
//     public CanFilter(CanId id, int mask) {
//         this(id, new CanId(mask));
//     }
//     
//     public CanFilter(CanId id, CanId mask) {
//         this.id = id;
//         this.mask = mask;
//     }
//     
//     /**
//      * Inverts the operation of this filter
//      */
//     public void setInverted() {
//         id.setInverted();
//     }
//     
//     /**
//      * Clears the inversion of this filter
//      */
//     public void clearInverted() {
//         id.clearInverted();
//     }
//     
//     /**
//      * @return true if filter is inverted
//      */
//     public boolean isInverted() {
//         return id.isInverted();
//     }
//     
//     public can_filter toJnaType() {
//         return new can_filter(id.getId(), mask.getId());
//     }
//     
//     public void copyTo(can_filter filter) {
//         filter.can_id = id.getId();
//         filter.can_mask = mask.getId();
//     }
// }


// Path: netty/src/net/jazdw/jnacan/netty/CanChannelConfig.java
import net.jazdw.jnacan.CanFilter;
import io.netty.buffer.ByteBufAllocator;
import io.netty.channel.ChannelConfig;
import io.netty.channel.MessageSizeEstimator;
import io.netty.channel.RecvByteBufAllocator;

/*
 * Copyright (C) 2014 Jared Wiltshire. All rights reserved.
 * @author Jared Wiltshire
 */

package net.jazdw.jnacan.netty;


/**
 * Copyright (C) 2014 Jared Wiltshire. All rights reserved.
 * @author Jared Wiltshire
 */
public interface CanChannelConfig extends ChannelConfig {
    /**
     * @return true if time-stamping is enabled
     */
    boolean isTimestampEnabled();
    
    /**
     * Sets if the socket should time-stamp frames
     * @param timestamp
     * @return
     */
    CanChannelConfig setTimestampEnabled(boolean timestamp);

    /**
     * @return true if loop-back enabled
     */
    boolean isLoopback();
    
    /**
     * Sets the loop-back behavior
     * @param loopback
     * @return
     */
    CanChannelConfig setLoopback(boolean loopback);

    /**
     * @return true if socket receives its own messages
     */
    boolean isRecvOwnMsgs();
    
    /**
     * Sets the receive own messages behavior
     * @param recvOwnMsgs
     * @return
     */
    CanChannelConfig setRecvOwnMsgs(boolean recvOwnMsgs);

    /**
     * @return the CAN interface filters
     */
    CanFilter[] getFilters();
    
    /**
     * Sets the CAN interface filters
     * @param filters
     * @return
     */
    CanChannelConfig setFilters(CanFilter... filters);

    /**
     * @return the can interface error filter
     */
    int getErrorFilter();
    
    /**
     * Sets the can interface error filter
     * @param errorFilter
     * @return
     */
    CanChannelConfig setErrorFilter(int errorFilter);