Skip to content

Commit 581a49e

Browse files
committed
Pin where the Toggle bit sits in the Protocol Control
1 parent 605f7fb commit 581a49e

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

test/native/test_uhf_codec/uhf_test.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

296316
TEST(UHF, BuildSelectParameter)

0 commit comments

Comments
 (0)