Package org.jboss.netty.buffer

Examples of org.jboss.netty.buffer.ChannelBuffer.readUnsignedShort()


            // Key switch
            extendedInfo.set("key", buf.readUnsignedByte());

            // Oil
            extendedInfo.set("oil", buf.readUnsignedShort() / 10.0);

            // Power
            extendedInfo.set("power", buf.readUnsignedByte() + buf.readUnsignedByte() / 100.0);

            // Milage
View Full Code Here


        // Zero for location messages
        buf.readByte(); // voltage
        buf.readByte(); // gsm signal

        String imei = readImei(buf);
        long index = buf.readUnsignedShort();
        int type = buf.readUnsignedByte();

        if (type == MSG_HEARTBEAT) {
            if (channel != null) {
                byte[] response = {0x54, 0x68, 0x1A, 0x0D, 0x0A};
View Full Code Here

            // Speed
            position.setSpeed((double) buf.readUnsignedByte());

            // Course
            position.setCourse((double) buf.readUnsignedShort());

            buf.skipBytes(3); // reserved

            // Flags
            long flags = buf.readUnsignedInt();
View Full Code Here

            throws Exception {

        ChannelBuffer buf = (ChannelBuffer) msg;

        // Read header
        int apiNumber = buf.readUnsignedShort();
        int commandType = buf.readUnsignedByte();
        int messageType = buf.getUnsignedByte(buf.readerIndex()) >> 4;
        boolean needAck = (buf.readUnsignedByte() & 0xf) == 1;
        long mask = 0;
        if (buf.readUnsignedByte() == 4) {
View Full Code Here

                return null;
            }

            // IO data
            if (checkBit(mask, 3)) {
                buf.readUnsignedShort();
            }

            // ADC 1
            if (checkBit(mask, 4)) {
                buf.readUnsignedShort();
View Full Code Here

                buf.readUnsignedShort();
            }

            // ADC 1
            if (checkBit(mask, 4)) {
                buf.readUnsignedShort();
            }

            // ADC 2
            if (checkBit(mask, 5)) {
                buf.readUnsignedShort();
View Full Code Here

                buf.readUnsignedShort();
            }

            // ADC 2
            if (checkBit(mask, 5)) {
                buf.readUnsignedShort();
            }

            // Function category
            if (checkBit(mask, 7)) {
                buf.readUnsignedByte();
View Full Code Here

                position.setLongitude(convertCoordinate(buf.readUnsignedInt()));
            }

            // Speed
            if (checkBit(mask, 12)) {
                position.setSpeed(buf.readUnsignedShort() / 10.0);
            }

            // Course
            if (checkBit(mask, 13)) {
                position.setCourse(buf.readUnsignedShort() / 10.0);
View Full Code Here

                position.setSpeed(buf.readUnsignedShort() / 10.0);
            }

            // Course
            if (checkBit(mask, 13)) {
                position.setCourse(buf.readUnsignedShort() / 10.0);
            }

            // Time
            if (checkBit(mask, 14)) {
                time.set(Calendar.HOUR_OF_DAY, buf.readUnsignedByte());
View Full Code Here

                extendedInfo.set("satellites", buf.readUnsignedByte());
            }

            // Battery percentage
            if (checkBit(mask, 17)) {
                buf.readUnsignedShort();
            }

            // Trip milage
            if (checkBit(mask, 20)) {
                extendedInfo.set("trip", buf.readUnsignedInt());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.