Rotate the link-layer address with the pseudonym again
The app sends the pseudonym's MAC in the 16-octet STATION_CONFIGURE (address_configuration 0), the station uses it for unsigned frames too, and a different MAC reconfigures the station. A ride rotates it with the station ID; the bench CAM pinger keeps one. Without a MAC the station behaves as before (ticket-derived when signed, random when unsigned). tools/station_tx_test.py plays the phone over USB and reads the station's own raw capture (source MAC, signed or not, submitted and completed counts). Add the 16-octet form to the spec (revision 2), a firmware unit test and an app test. Fix the stale Connection texts.
This commit is contained in:
@@ -42,6 +42,20 @@ class StationLinkTest {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `STATION_CONFIGURE with a MAC is the 16-octet form that names the address`() {
|
||||
// type 2, security on, address_configuration 0 (AUTO), the MAC, no beaconing, channel 180, 20 dBm, TX+RX, DP2, 1 s
|
||||
val body = StationConfigure(stationType = 2, mid = "021122334455".hexToBytes()).encode()
|
||||
assertEquals(
|
||||
"0100070002010002112233445500b40014020205",
|
||||
LinkMessage(LinkOpcode.STATION_CONFIGURE, 7, body).encode().hex(),
|
||||
)
|
||||
// another MAC is another configuration (the station is reconfigured), the same MAC is the same one
|
||||
assertEquals(StationConfigure(2, mid = "021122334455".hexToBytes()), StationConfigure(2, mid = "021122334455".hexToBytes()))
|
||||
assertFalse(StationConfigure(2, mid = "021122334455".hexToBytes()) == StationConfigure(2, mid = "021122334466".hexToBytes()))
|
||||
assertFalse(StationConfigure(2, mid = "021122334455".hexToBytes()) == StationConfigure(2))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `POTI_UPDATE matches the Python encoder`() {
|
||||
val body = PotiUpdate(
|
||||
|
||||
Reference in New Issue
Block a user