ST意法半导体
直播中

金鼎

7年用户 173经验值
私信 关注
[问答]

包含多个记录的NDEF中哪里出错了?

嗨,


我正在尝试设置一个包含多个记录的NDEF。

//写NDEF消息(命令C-APDU - 数据表5.2.1 p32)
ndef [0] = 0x02; // PCB
ndef [1] = 0x00; // CLA:类字节
ndef [2] = 0xD6; // INS:指令字节
ndef [3] = 0x00; // P1:参数字节1
ndef [4] = 0x02; // P2:参数字节2

ndef [5] = 5 + 5 + 7 + 5 + 1; // Lc:数据字段的字节数

//记录& sharp1
ndef [6] = 0x91; // MB |我| CF | SR | IL | TNF
ndef [7] = 0x01; //类型长度
ndef [8] = 5 + 1; //有效载荷长度
ndef [9] ='U'; //输入字段:'U' - URL,'T' - 文本,...
ndef [10] = 0x01; // URI标识符 - > 0x01 =''http:// www。'',0x03 =''http://''

NDEF [11] = 'S';
NDEF [12] = 'T';
NDEF [13] = '';
NDEF [14] = 'd';
NDEF [15] = 'E';

//记录& sharp2
ndef [16] = 0x51; // MB |我| CF | SR | IL | TNF
ndef [17] = 0x01; //类型长度
ndef [18] = 5 + 1; //有效载荷长度
ndef [19] ='T'; //输入字段:'U' - URL,'T' - 文本,...
ndef [20] = 0x02; //
ndef [21] ='e'; //
ndef [22] ='n'; //

NDEF [23] = 'H';
NDEF [24] = 'A';
NDEF [25] = 'L';
NDEF [26] = 'L';
NDEF [27] = 'O';


send_command(ndef,30); // 28bytes DEF长度+ 2bytes CRC
delay_ms(NDEF_WRITE_DELAY);
i2c_read_n_reg_M24SR(M24SR_ADDR,0,5);




不幸的是,数据没有写入M24SR芯片。哪里不对?
#multiple-ndef#m24sr

以上来自于谷歌翻译


以下为原文




Hi,


I'm trying to set up a NDEF with multiple records.

     // write NDEF message (command C-APDU - datasheet 5.2.1 p32)
     ndef[0] = 0x02;                // PCB:
     ndef[1] = 0x00;                // CLA: class byte
     ndef[2] = 0xD6;                // INS: instruction byte
     ndef[3] = 0x00;                // P1: param byte 1
     ndef[4] = 0x02;                // P2: param byte 2

     ndef[5] = 5 + 5 + 7 + 5 + 1;        // Lc: number of bytes of the data field

     // record &sharp1
     ndef[6] = 0x91;             // MB | ME | CF | SR | IL | TNF
     ndef[7] = 0x01;                // type length
     ndef[8] = 5+1;               // payload length
     ndef[9] = 'U';              // Type field: 'U' - URL, 'T' - text, ...
     ndef[10] = 0x01;               // URI identifier -> 0x01 = ''http://www.'', 0x03 = ''http://''

     ndef[11]='s';
     ndef[12]='t';
     ndef[13]='.';
     ndef[14]='d';
     ndef[15]='e';

     // record &sharp2
     ndef[16] = 0x51;             // MB | ME | CF | SR | IL | TNF
     ndef[17] = 0x01;                // type length
     ndef[18] = 5+1;               // payload length
     ndef[19] = 'T';              // Type field: 'U' - URL, 'T' - text, ...
     ndef[20] = 0x02;               //
     ndef[21] = 'e';               //
     ndef[22] = 'n';               //

     ndef[23]='H';
     ndef[24]='a';
     ndef[25]='l';
     ndef[26]='l';
     ndef[27]='o';


     send_command(ndef, 30);                                  // 28bytes DEF length + 2bytes CRC
     delay_ms(NDEF_WRITE_DELAY);
     i2c_read_n_reg_M24SR(M24SR_ADDR,0,5);




Unfortunatly the data does not get written to the M24SR chip. What is wrong?  
#multiple-ndef #m24sr

回帖(1)

陈秀英

2019-7-18 16:30:07
嗨,
 
 您是否尝试在Google Play上使用“多个NFC NDEF记录应用程序”?
 
 源代码可在我们的网站STSW-M24SR005上找到
http://www.st.com/web/en/catalog/tools/PF261531
 
 
 我希望这有帮助,
 
 祝你今天愉快,
 
 祝一切顺利,
 ST NFC / RFID支持

以上来自于谷歌翻译


以下为原文







Hi ,

Have you tried to use ''Multiple NFC NDEF Records App'' available on google play?

And the source code are available on our website STSW-M24SR005   
http://www.st.com/web/en/catalog/tools/PF261531


I hope this is helping,

Have a nice day,

All the best,
ST NFC/RFID support
举报

更多回帖

发帖
×
20
完善资料,
赚取积分