The slot cannot be set for files. There is no FILE_SLOT command. For files slot is always -1:
|
packet_t *packet = getPacket(comInCMD, slot); |
Unluckily, FILE_OPEN used the file ID as slot number when pushing the packet, thus this value cannot be read
|
pushPacket(HUB_FILE_OPEN, comInBuffer[0]); |
Two solutions:
- fix this to be -1 (like in FILE_READ)
|
pushPacket(HUB_FILE_READ, -1); |
- add a FILE_SLOT command, and change FILE read to use the file slot.
In the handy emulation code this is broken as well. But here both functions use a slot number.
The slot cannot be set for files. There is no FILE_SLOT command. For files slot is always -1:
8bit-Hub/Firmware/Hub-Mega2560/Hub-Mega2560.ino
Line 624 in 8208f6e
Unluckily, FILE_OPEN used the file ID as slot number when pushing the packet, thus this value cannot be read
8bit-Hub/Firmware/Hub-Mega2560/Hub-Mega2560.ino
Line 1421 in 8208f6e
Two solutions:
8bit-Hub/Firmware/Hub-Mega2560/Hub-Mega2560.ino
Line 1437 in 8208f6e
In the handy emulation code this is broken as well. But here both functions use a slot number.