Repository navigation
Conversation
… magic number and endian usage
|
@arkadiuszwojcik could you take a look please? |
| // The radio can automatically reassociate while command replies are being | ||
| // polled. When retrying the same credentials, keep that authenticated link | ||
| // instead of clearing its events and aborting it with another set_ssid. | ||
| if (opt.preserve_auto_reconnect and |
There was a problem hiding this comment.
what does this expression even mean?
There was a problem hiding this comment.
It's how you can test for authenticated reassociation. I've pulled the test expression out into a helper method to make it more clear what's being checked.
| const is_event = self.index < events.len; | ||
| const len: u16 = if (is_event) JoinTestPackets.event_len else JoinTestPackets.control_len; | ||
| if (words.len == 2) { // bus-status read, plus trailing SPI status word | ||
| // gSPI status: F2 packet available at bit 8, packet length at bits 9..19. |
There was a problem hiding this comment.
Why are you including the positions of fields and lengths in comments, and doing raw bit manipulations, and duplicating them in tests? This is a very odd choice given you have BusStatus defined as a packed struct, and I had already guided you to not use magic numbers.
There was a problem hiding this comment.
The primary reason was because most of the structs I would have needed from ioctl.zig weren't public, so I manually tracked positions and set bytes rather than changing that file (aiming for a contained fix and tests within wifi.zig).
But you're right, it's cleaner to directly use those structs, so I've made them public in ioctl.zig so I can reuse them (along with BusStatus) here.
Motivation
Description of changes