Package com.sun.jna

Examples of com.sun.jna.NativeLong


    }*/

    static long SCardConnect(long contextId, String readerName, int shareMode, int preferredProtocols) throws PcScException {
        NativeLongByReference phCard = new NativeLongByReference();
        IntByReference pdwActiveProtocol = new IntByReference();
        NativeLong status = nimpPcscDll.NimpSCardConnectW(new NativeLong(contextId), new WString(readerName), shareMode, preferredProtocols,
                phCard,
                pdwActiveProtocol);
        if (SCARD_S_SUCCESS != status.longValue()) {
            throw new PcScException(status.intValue());
        }
        return phCard.getValue().longValue();
    }
View Full Code Here


    }

    static long SCardReconnect(long cardId, int shareMode, int preferredProtocols, int activationPolicy) throws PcScException {
        NativeLongByReference phCard = new NativeLongByReference();
        IntByReference pdwActiveProtocol = new IntByReference();
        NativeLong status = nimpPcscDll.NimpSCardReconnect(new NativeLong(cardId), shareMode, preferredProtocols,
                activationPolicy,
                pdwActiveProtocol);
        if (SCARD_S_SUCCESS != status.longValue()) {
            throw new PcScException(status.intValue());
        }
        return phCard.getValue().longValue();
    }
View Full Code Here

            for (int i = 0; i < len; i++) {
                temp[i] = buf[ofs + i];
            }
            buf = temp;
        }
        NativeLong callStatus = nimpPcscDll.NimpSCardTransmit(new NativeLong(cardId),
                pioSendPci,
                buf, len,
                (NimpPcscDll.SCARD_IO_REQUEST) null,
                pbRecvBuffer, pcbRecvLength);
        if (SCARD_S_SUCCESS != callStatus.longValue()) {
            throw new PcScException("buf.length="+buf.length+", len="+len,callStatus.intValue());
        }
        byte out[] = new byte[pcbRecvLength.getValue()];
        for (int i = 0; i < pcbRecvLength.getValue(); i++) {
            out[i] = pbRecvBuffer[i];
        }
View Full Code Here

        IntByReference pdwState = new IntByReference();
        IntByReference pdwProtocol = new IntByReference();
        byte pbAtr[] = new byte[36];
        IntByReference pcbAtrLen = new IntByReference();
        pcbAtrLen.setValue(36);
        NativeLong callStatus = nimpPcscDll.NimpSCardStatusW(new NativeLong(cardId), null, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen);
        if (SCARD_S_SUCCESS != callStatus.longValue()) {
            throw new PcScException(callStatus.intValue());
        }
        byte out[] = new byte[pcbAtrLen.getValue()];
        for (int i = 0; i < pcbAtrLen.getValue(); i++) {
            out[i] = pbAtr[i];
        }
View Full Code Here

        status[1]=(byte) pdwProtocol.getValue();
        return out;
    }

    static void SCardDisconnect(long cardId, int disposition) throws PcScException {
        NativeLong status = nimpPcscDll.NimpSCardDisconnect(new NativeLong(cardId), disposition);
        if (SCARD_S_SUCCESS != status.longValue()) {
            throw new PcScException(status.intValue());
        }
    }
View Full Code Here

            readerStates[i].dwEventState = SCARD_STATE_UNAWARE;
            readerStates[i].cbAtr = 0;
            readerStates[i].rgbAtr = new byte[36];
        }

        NativeLong status = nimpPcscDll.NimpSCardGetStatusChangeW(new NativeLong(contextId), (int) timeout, readerStates, readerNames.length);
        if (SCARD_S_SUCCESS != status.longValue()) {
            throw new PcScException(status.intValue());
        }
        int out[] = new int[readerNames.length];
        for (int i = 0; i < readerNames.length; i++) {
            out[i] = readerStates[i].dwEventState;
        }
View Full Code Here

        assertEquals("returning to OC", 42, result.anInt);
        assertEquals("returning to OC", Math.PI, result.aDouble, 0.00001);
    }
   
    @Test public void testSendAndReceiveNativeLong() {
        NativeLong result = Foundation.send(proxy.id(), "takesNativeLongReturnsNativeLong:",
                NativeLong.class, new NativeLong(42));
        assertEquals(42, result.longValue());
    }
View Full Code Here

        this(timeValue, timeScale, 0);
    }

    public QTTimeByReference(long timeValue, int timeScale, int flags) {
        this.timeValue = timeValue;
        this.timeScale = new NativeLong(timeScale);
        this.flags = new NativeLong();
    }
View Full Code Here

            System.out.println("[" + Shared.now() + "] " + this.getClass().getName() + " " + Shared.lineNumber() " Fecha enviada: " + calendar.get(Calendar.DAY_OF_MONTH) + "/" + (calendar.get(Calendar.MONTH)+1) + "/"
                    + (byte)(calendar.get(Calendar.YEAR)%100)+ " " + hour + ":" + calendar.get(Calendar.MINUTE)
                    + ":" + calendar.get(Calendar.SECOND) + " " + ((calendar.get(Calendar.AM_PM) == Calendar.AM)?0:1));
            System.out.println("[" + Shared.now() + "] " + this.getClass().getName() + " " + Shared.lineNumber() " Abriendo documentos...");
            ans = printer.NewDoc(Integer.parseInt(Shared.getConfig("receipt")), client.getName(), client.getId(),
                    Shared.getUser().getLogin() + " " + ticketId, "ABC", new NativeLong(0), (calendar.get(Calendar.DAY_OF_MONTH)),
                    //(calendar.get(Calendar.MONTH)+1), calendar.get(Calendar.YEAR)%100+Constants.ncrYearOffset, (calendar.get(Calendar.HOUR)+12)%13,
                    (calendar.get(Calendar.MONTH)+1), calendar.get(Calendar.YEAR)%100, hour,
                    calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND),
                    ((calendar.get(Calendar.AM_PM) == Calendar.AM)?0:1) ,(calendar.get(Calendar.DAY_OF_MONTH)),
                    (calendar.get(Calendar.MONTH)+1), calendar.get(Calendar.YEAR)%100, hour,
View Full Code Here

            calendar.setTime(dd);

            int hour = calendar.get(Calendar.HOUR) == 0?12:calendar.get(Calendar.HOUR);

            int ans = printer.NewDoc(Integer.parseInt(Shared.getConfig("nonfiscalDoc")), "SAUL", "123",
                    Shared.getUser().getLogin(), "", new NativeLong(0), (calendar.get(Calendar.DAY_OF_MONTH)),
                    //(calendar.get(Calendar.MONTH)+1), calendar.get(Calendar.YEAR)%100+Constants.ncrYearOffset, (calendar.get(Calendar.HOUR)+12)%13,
                    (calendar.get(Calendar.MONTH)+1), calendar.get(Calendar.YEAR)%100, hour,
                    calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND),
                    ((calendar.get(Calendar.AM_PM) == Calendar.AM)?0:1) ,(calendar.get(Calendar.DAY_OF_MONTH)),
                    (calendar.get(Calendar.MONTH)+1), calendar.get(Calendar.YEAR)%100, hour,
View Full Code Here

TOP

Related Classes of com.sun.jna.NativeLong

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.