All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.dvlopt.linux.gpio.internal.NativeGpioEventRequest Maven / Gradle / Ivy

/*
 * Copyright 2018 Adam Helinski
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


package io.dvlopt.linux.gpio.internal ;


import com.sun.jna.Structure ;
import java.util.Arrays      ;
import java.util.List        ;




/**
 * This class has be to public for JNA to work as needed, the user should not care about it.
 */
public class NativeGpioEventRequest extends Structure {


    public int    line                         ;
    public int    handleFlags                  ;
    public int    eventFlags                   ;
    public byte[] consumer    = new byte[ 32 ] ;
    public int    fd                           ;


    public static int OFFSET_LINE         ;
    public static int OFFSET_HANDLE_FLAGS ;
    public static int OFFSET_EVENT_FLAGS  ;
    public static int OFFSET_CONSUMER     ;
    public static int OFFSET_FD           ;
    public static int SIZE                ;


    static {
    
        NativeGpioEventRequest nativeStruct = new NativeGpioEventRequest() ;

        OFFSET_LINE         = nativeStruct.fieldOffset( "line"        ) ;
        OFFSET_HANDLE_FLAGS = nativeStruct.fieldOffset( "handleFlags" ) ;
        OFFSET_EVENT_FLAGS  = nativeStruct.fieldOffset( "eventFlags"  ) ;
        OFFSET_CONSUMER     = nativeStruct.fieldOffset( "consumer"    ) ;
        OFFSET_FD           = nativeStruct.fieldOffset( "fd"          ) ;
        SIZE                = nativeStruct.size()                       ;
    }




    protected List< String > getFieldOrder() {
    
        return Arrays.asList( new String[] { "line"        ,
                                             "handleFlags" ,
                                             "eventFlags"  ,
                                             "consumer"    ,
                                             "fd"          } ) ;
    }
}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy