嗨,
我正在尝试设置一个包含多个记录的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芯片。哪里不对?
#mul
tiple-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