Package org.jboss.netty.buffer

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


                    lastIndex = buf.readUnsignedInt() + 1;
                    extendedInfo.set("index", lastIndex);

                    subtype = buf.readUnsignedShort();
                    if (subtype != MSG_TYPE_CURRENT_GPS_DATA && subtype != MSG_TYPE_STATE_FULL_INFO_T104) {
                        buf.skipBytes(buf.readUnsignedShort());
                        continue;
                    }
                    buf.readUnsignedShort(); // length
                }
View Full Code Here


                    subtype = buf.readUnsignedShort();
                    if (subtype != MSG_TYPE_CURRENT_GPS_DATA && subtype != MSG_TYPE_STATE_FULL_INFO_T104) {
                        buf.skipBytes(buf.readUnsignedShort());
                        continue;
                    }
                    buf.readUnsignedShort(); // length
                }

                // Time
                Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
                time.clear();
View Full Code Here

                   
                    // Cell signal
                    extendedInfo.set("gsm", buf.readUnsignedByte());

                    // Event type
                    extendedInfo.set("event", buf.readUnsignedShort());

                    // Milage
                    extendedInfo.set("milage", buf.readUnsignedInt());

                    // Input/Output
View Full Code Here

                    extendedInfo.set("input", buf.readUnsignedByte());
                    extendedInfo.set("output", buf.readUnsignedByte());
                   
                    // Analog sensors
                    for (int i = 1; i <= 8; i++) {
                        extendedInfo.set("adc" + i, buf.readUnsignedShort());
                    }
                   
                    // Counters
                    extendedInfo.set("c0", buf.readUnsignedInt());
                    extendedInfo.set("c1", buf.readUnsignedInt());
View Full Code Here

            throws Exception {

        ChannelBuffer buf = (ChannelBuffer) msg;
        buf.skipBytes(2); // prefix
        buf.readUnsignedShort(); // checksum
        buf.readUnsignedShort(); // length
        int index = buf.readUnsignedShort();

        // Get device id
        long deviceId;
        long rawId = buf.readLong();
View Full Code Here

        ChannelBuffer buf = (ChannelBuffer) msg;
        buf.skipBytes(2); // prefix
        buf.readUnsignedShort(); // checksum
        buf.readUnsignedShort(); // length
        int index = buf.readUnsignedShort();

        // Get device id
        long deviceId;
        long rawId = buf.readLong();
        String id = String.valueOf(rawId);
View Full Code Here

            position.setLongitude(buf.readInt() * 0.000001);
            position.setLatitude(buf.readInt() * 0.000001);
            position.setAltitude(0.0);

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

            // Report type
            extendedInfo.set("type", buf.readUnsignedByte());

            // Milage
View Full Code Here

            // Milage
            extendedInfo.set("milage", buf.readUnsignedInt() * 0.1);

            // Accuracy
            extendedInfo.set("hdop", buf.readUnsignedShort() * 0.1);

            // Input
            extendedInfo.set("input", buf.readUnsignedByte());

            // Speed
View Full Code Here

            // Input
            extendedInfo.set("input", buf.readUnsignedByte());

            // Speed
            position.setSpeed(buf.readUnsignedShort() * 0.539957);

            // Output
            extendedInfo.set("output", buf.readUnsignedByte());

            // ADC
View Full Code Here

            // Output
            extendedInfo.set("output", buf.readUnsignedByte());

            // ADC
            extendedInfo.set("adc", buf.readUnsignedShort() * 0.001);

            // Driver
            extendedInfo.set("driver", readString(buf));

            // Temperature
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.