Code Monkey home page Code Monkey logo

Comments (3)

jlcout avatar jlcout commented on August 22, 2024

Hello prlwtz!

I fixed the compilation problem. Please test and report.

Soon, I will study the SGCN specification and implement it

from epctagcoder.

prlwtz avatar prlwtz commented on August 22, 2024

Hi José,

I replaced the whole 'org' source folder in my project and it compiled without any issues. Thanks.

With regards to SGCN, I don't have an immediate need for it at the moment, I just noticed the missing APIs while implementing the library into my RFID parser.

With regards to that parsing, I now have an iterating loop trying parse through the various objects.


private enum EPC {
        SGTIN,
        SSCC,
        SGLN,
        GRAI,
        GIAI,
        GSRN,
        GSRNP,
        GDTI,
        CPI
    };

    String data = "";
    for (int i = 0 ; i<EPC.values().length && data.length()==0 ; i++) {
                            EPC epc = EPC.values()[i];

                            switch (epc) {

                                case SGTIN:
                                    // SGTIN - Serialized Global Trade Item Number
                                    // urn:epc:id:sgtin:CompanyPrefix.ItemRefAndIndicator.SerialNumber
                                    try {
                                        ParseSGTIN parseSGTIN = ParseSGTIN.Builder().withRFIDTag(hex_data).build();
                                        SGTIN sgtin = parseSGTIN.getSGTIN();
                                        data = sgtin.getEpcPureIdentityURI();
                                    } catch (Exception parse_e) {
                                    }
                                    break;

                                case SSCC:
                                    // SSCC - Serial Shipping Container Code
                                    // urn:epc:id:sscc:CompanyPrefix.SerialReference
                                    try {
                                        ParseSSCC parseSSCC = ParseSSCC.Builder().withRFIDTag(hex_data).build();
                                        SSCC sscc = parseSSCC.getSSCC();
                                        data = sscc.getEpcPureIdentityURI();
                                    } catch (Exception parse_e) {
                                    }
                                    break;


etc etc

Is there an better way of simply parsing the hex data and just get an object with the appropriate contents? Or is this just the way it currently is?

Kind regards,
Eize

from epctagcoder.

jlcout avatar jlcout commented on August 22, 2024

I'm glad it worked.

There is no other way to parse hexadecimal data. Each class is specific to resolve certain hexadecimal. Your loop is perfect and I don't see any other way.

from epctagcoder.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.