paulobunga / c72-rfid-scanner

RFID Scanner module for Chainway C72 Scanner
14 stars 6 forks source link

Lock Tag #50

Closed ItxAltaf closed 4 months ago

ItxAltaf commented 5 months ago

Hello Mr. @paulobunga I want to implement lock RFID tag functionality but facing issues here is my code : @ReactMethod public void uhfBlockPermalock(String targetEpc,String pwdStr, final Promise promise) { // epc += password; // epc += "00000000"; //old // Access Password, Bank Enum (EPC(1), TID(2),...), Pointer, Count, Data //Boolean uhfWriteState = mReader.writeData_Ex("00000000", BankEnum.valueOf("UII"), 2, 6, epc); // boolean result=mContext.mReader.uhfBlockPermalock(pwdStr,filter_bank,filter_ptr,filter_len,filter_data,readLock,bank,prt,uRange,mastBuff); // targetEpc += pwdStr;

    try {

        byte[] maskBytes = StringUtility.hexString2Bytes(targetEpc);

        Boolean result=mReader.uhfBlockPermalock(pwdStr,IUHF.Bank_EPC,0,0,targetEpc,1,IUHF.Bank_EPC,2,1,maskBytes); //,readLock,bank,prt,uRange,mastBuff
        // Boolean result=mReader.lockMem(targetEpc,1,2,3,pwdStr,""); 

        promise.resolve(result);
        // Log.d("UHF_SCANNER", String.valueOf(uhfPower));

    } catch (Exception ex) {
        Log.d("UHF_SCANNER", ex.getLocalizedMessage());
        promise.reject(UHF_READER_OTHER_ERROR, ex.getLocalizedMessage());
    }
    }
paulobunga commented 5 months ago

What issues are you experiencing?

[image: Mailtrack] https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11& Sender notified by Mailtrack https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11& 25/06/24, 17:00:58

On Tue, Jun 25, 2024 at 3:24 PM Altaf H. @.***> wrote:

Hello Mr. @paulobunga https://github.com/paulobunga I want to implement lock RFID tag functionality but facing issues here is my code : @ReactMethod public void uhfBlockPermalock(String targetEpc,String pwdStr, final Promise promise) { // epc += password; // epc += "00000000"; //old // Access Password, Bank Enum (EPC(1), TID(2),...), Pointer, Count, Data //Boolean uhfWriteState = mReader.writeData_Ex("00000000", BankEnum.valueOf("UII"), 2, 6, epc); // boolean result=mContext.mReader.uhfBlockPermalock(pwdStr,filter_bank,filter_ptr,filter_len,filter_data,readLock,bank,prt,uRange,mastBuff); // targetEpc += pwdStr;

try {

    byte[] maskBytes = StringUtility.hexString2Bytes(targetEpc);

    Boolean result=mReader.uhfBlockPermalock(pwdStr,IUHF.Bank_EPC,0,0,targetEpc,1,IUHF.Bank_EPC,2,1,maskBytes); //,readLock,bank,prt,uRange,mastBuff
    // Boolean result=mReader.lockMem(targetEpc,1,2,3,pwdStr,"");

    promise.resolve(result);
    // Log.d("UHF_SCANNER", String.valueOf(uhfPower));

} catch (Exception ex) {
    Log.d("UHF_SCANNER", ex.getLocalizedMessage());
    promise.reject(UHF_READER_OTHER_ERROR, ex.getLocalizedMessage());
}
}

— Reply to this email directly, view it on GitHub https://github.com/paulobunga/c72-rfid-scanner/issues/50, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOP4W2AZNL6CLSNHVBHN6TZJFOQPAVCNFSM6AAAAABJ3VRQPKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM3TENBYHEZDSNY . You are receiving this because you were mentioned.Message ID: @.***>

ItxAltaf commented 5 months ago

uhfBlockPermalock

I have tried both uhfBlockPermalock and lockMem but both returns false.

e.g: Boolean result=mReader.uhfBlockPermalock(pwdStr,IUHF.Bank_EPC,0,0,targetEpc,1,IUHF.Bank_EPC,2,1,maskBytes);

e.g: Boolean result=mReader.lockMem(targetEpc,1,2,3,pwdStr,"")

I want to permanently lock the tag so that no one can modify it.

paulobunga commented 5 months ago

Will definitely look into it within the coming weeks. If you would love expeditated assistance on this issue, I could look into it soon for a small donation.

ItxAltaf commented 5 months ago

I appreciate your willingness to look into the issue. Unfortunately, I'm not in a position to make a donation at this time. However, if you could provide a hint or some helpful material, it would be greatly appreciated. Any guidance you can offer would be very helpful.