Skip to main content
Visitor II
July 24, 2023
Solved

I had a problem sending the 0xB3 custom command using the handler.customCommand function.

  • July 24, 2023
  • 2 replies
  • 2351 views

Hello!

I'm using a build of type st25dv64k

For iOS operating systems, use the NfcManager.requestTechnology(NfcTech.Iso15693IOS) technology and for the password:
NfcManager.iso15693HandlerIOS.customCommand(
flags = number,
customCommandCode = number,
customRequestParameters= [] );

I am using the structure

I had a problem sending the 0xB3 custom command using the handler.customCommand function.

Here is my code, I can't see any error there, but my RN code only will give me that [error] message, without giving me any information about what is going on.

try { const idBytes= [1,2,3,4,5,6,7,8]; const passwordBytes= [0,0,0,0,0,0,0,0]
 resp = await NfcManager.iso15693HandlerIOS.customCommand({
 flags = 0x02,
 customCommandCode = 0xb3,
 customRequestParameters = [
0x02, 0xb3, 0x02, ...idBytes, 0x02, ...passwordBytes, ], });

Giving me this error:
Error [error]
Could you help me out?

Thanks!

    This topic has been closed for replies.
    Best answer by victor laraison

    Hi rerdo,

    The iOS CoreNFC custom command works only in NON-ADDRESSED mode. 
    flags value is OK into your command, but you must remove the  IC Device Code (0x02) and UID from the custom request parameters. 
    If you have a look into the code we provide, we make the call as follow :

     self.mTag.customCommand(requestFlags: [.highDataRate], customCommandCode: Int(code),customRequestParameters:data)

    where data = PasswordNumber + Password Value.

    Hope it clarifies.

    Br,

     

    2 replies

    ST Employee
    July 26, 2023

    hello Rerdo,
    Please, could you log the error returned by the iso15693 command ? 
    Otherwise, is it normal to resend into customrequestParameters the flags and customcommand ? Normally you should only pass the data for the commands. 
    Let me know.
    Br,

     

    rerdo.1Author
    Visitor II
    July 26, 2023

    Hello Victor,

    When I run the program in the way I wrote above, when I press the error message on the screen in the try catch section, I get a message like this :

    Error [error]

    Unfortunately, it does not give an output other than this.

    As you said, when I extract the flags and customcommand values from the customRequestParameters array, a structure is formed as follows :

    try { const idBytes=[1,2,3,4,5,6,7,8]; const passwordBytes= [0,0,0,0,0,0,0,0,0]
    resp = await NfcManager.iso15693HandlerIOS.customCommand({
    flags=0x02,
    custom Command Code = 0xb3,
    custom Request Parameters = [
    0x02, //IC Mfg code
    ......id Bytes, // device id =[0, 1, 2, 3, 4, 5, 6, 7]
    0x02, // Passwordnumber
    ...passwordBytes, // Password =[0,0,0,0,0,0,0,0]
    ],
    });
    }
    catch(ex) {
    console.log('error',ex);
    } finally {
    console.log("Finally..");
    }
    

     

    i get the same form error error when I try.

    Where am I doing wrong here, what should I do, can you help me?

    ST Employee
    September 14, 2023

    Hi rerdo,

    The iOS CoreNFC custom command works only in NON-ADDRESSED mode. 
    flags value is OK into your command, but you must remove the  IC Device Code (0x02) and UID from the custom request parameters. 
    If you have a look into the code we provide, we make the call as follow :

     self.mTag.customCommand(requestFlags: [.highDataRate], customCommandCode: Int(code),customRequestParameters:data)

    where data = PasswordNumber + Password Value.

    Hope it clarifies.

    Br,