@@ -291,6 +291,26 @@ TEST(UHF, DecodeProtocolControl)
291291 // XPC indicator and a non-EPCglobal numbering system
292292 EXPECT_TRUE (m5::uhf::pcXPCIndicator (0x3200 ));
293293 EXPECT_EQ (m5::uhf::pcNumberingSystemIdentifier (0x3055 ), 0x055 );
294+
295+ // Bit 10h of the PC is the most significant one of the word, so the Toggle at 17h is the
296+ // eighth down. Every tag this ran against reports it clear, and a tag asserting it is
297+ // saying the EPC bank holds an ISO UII instead of an EPC
298+ EXPECT_FALSE (m5::uhf::pcToggle (0x3000 ));
299+ EXPECT_FALSE (m5::uhf::pcToggle (0x3400 ));
300+ EXPECT_TRUE (m5::uhf::pcToggle (0x3100 ));
301+
302+ // The three bits below the length are read one at a time, and setting one does not disturb
303+ // its neighbours
304+ EXPECT_TRUE (m5::uhf::pcUserMemoryIndicator (0x3400 ) && !m5::uhf::pcXPCIndicator (0x3400 ) &&
305+ !m5::uhf::pcToggle (0x3400 ));
306+ EXPECT_TRUE (!m5::uhf::pcUserMemoryIndicator (0x3200 ) && m5::uhf::pcXPCIndicator (0x3200 ) &&
307+ !m5::uhf::pcToggle (0x3200 ));
308+ EXPECT_TRUE (!m5::uhf::pcUserMemoryIndicator (0x3100 ) && !m5::uhf::pcXPCIndicator (0x3100 ) &&
309+ m5::uhf::pcToggle (0x3100 ));
310+ EXPECT_TRUE (m5::uhf::pcUserMemoryIndicator (0x3700 ) && m5::uhf::pcXPCIndicator (0x3700 ) && m5::uhf::pcToggle (0x3700 ));
311+
312+ // The length is untouched whichever of them is set
313+ EXPECT_EQ (m5::uhf::pcEPCLengthWords (0x3700 ), 6 );
294314}
295315
296316TEST (UHF , BuildSelectParameter)
0 commit comments