cancel
Showing results for 
Search instead for 
Did you mean: 

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

rerdo.1
Associate II

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!

1 ACCEPTED SOLUTION

Accepted Solutions
victor laraison
ST Employee

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,

 

View solution in original post

6 REPLIES 6
victor laraison
ST Employee

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,

 

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?

Hi @victor laraison Can you help me with the issue?

I see that you use @ mode, i suggest that you use 0x22 for Flags

For information:

In addressed mode (i.e. with UID parameter in the request), the Address_flag (bit 6) shall be set to 1. Usually Data_rate_flag (b2) is also set to 1 (High data rate shall be used):

b8 b7 b6 b5 b4 b3 b2 b1
 0  0  1  0  0  0  1  0
                      0   Sub-carrier_flag: A single sub-carrier frequency shall be used by the VICC
                   1 Data_rate_flag: High data rate shall be used
                0 Inventory_flag: Flags 5 to 8 meaning is according to table 4
             0 Protocol Extension_flag: No protocol format extension
          0 Select_flag
       1 Address_flag Request is addressed. UID field is included
    0 Option_flag
 0 RFU

For further information on request flags, see ISO/IEC 15693-3.

Hope this will help

BR,FB

I tried this way before but got the same error again. I don't understand what needs to be done here. I have tried many different ways to build but without success.

victor laraison
ST Employee

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,