Make RNDISHost demo validate the set Packet Filter to ensure that it is being sent correctly.
Add new (incomplete) StandaloneProgrammer project, using the ELM Petite FAT library to read files stored on the board's dataflash by the host.
This commit is contained in:
parent
79e54580ae
commit
9b20114555
26 changed files with 3957 additions and 13 deletions
|
|
@ -42,9 +42,10 @@
|
|||
#include "MassStorage.h"
|
||||
#include "Descriptors.h"
|
||||
|
||||
#include <LUFA/Common/Common.h> // Function Attribute, Atomic, Debug and ISR Macros
|
||||
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
|
||||
#include <LUFA/Drivers/Board/Dataflash.h> // Dataflash chip driver
|
||||
#include <LUFA/Common/Common.h> // Function Attribute, Atomic, Debug and ISR Macros
|
||||
#include <LUFA/Drivers/USB/USB.h> // USB Functionality
|
||||
#include <LUFA/Drivers/USB/Class/MassStorage.h> // Mass Storage Class Driver
|
||||
#include <LUFA/Drivers/Board/Dataflash.h> // Dataflash chip driver
|
||||
|
||||
/* Preprocessor Checks: */
|
||||
#if (DATAFLASH_PAGE_SIZE % 16)
|
||||
|
|
|
|||
|
|
@ -47,9 +47,7 @@
|
|||
#include "Lib/DataflashManager.h"
|
||||
|
||||
#include <LUFA/Version.h>
|
||||
#include <LUFA/Drivers/Board/Joystick.h>
|
||||
#include <LUFA/Drivers/Board/LEDs.h>
|
||||
#include <LUFA/Drivers/Board/Buttons.h>
|
||||
#include <LUFA/Drivers/USB/USB.h>
|
||||
#include <LUFA/Drivers/USB/Class/MassStorage.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ uint8_t RNDIS_GetEncapsulatedResponse(void* Buffer, uint16_t Length)
|
|||
return USB_Host_SendControlRequest(Buffer);
|
||||
}
|
||||
|
||||
uint8_t RNDIS_KeepAlive(void)
|
||||
uint8_t RNDIS_SendKeepAlive(void)
|
||||
{
|
||||
uint8_t ErrorCode;
|
||||
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@
|
|||
uint8_t RNDIS_SendEncapsulatedCommand(void* Buffer, uint16_t Length);
|
||||
uint8_t RNDIS_GetEncapsulatedResponse(void* Buffer, uint16_t Length);
|
||||
|
||||
uint8_t RNDIS_KeepAlive(void);
|
||||
uint8_t RNDIS_SendKeepAlive(void);
|
||||
uint8_t RNDIS_InitializeDevice(uint16_t HostMaxPacketSize, uint16_t* DeviceMaxPacketSize);
|
||||
uint8_t RNDIS_SetRNDISProperty(uint32_t Oid, void* Buffer, uint16_t Length);
|
||||
uint8_t RNDIS_QueryRNDISProperty(uint32_t Oid, void* Buffer, uint16_t MaxLength);
|
||||
|
|
|
|||
|
|
@ -247,6 +247,24 @@ void RNDIS_Host_Task(void)
|
|||
break;
|
||||
}
|
||||
|
||||
uint32_t RetrievedPacketFilter;
|
||||
if ((ErrorCode = RNDIS_QueryRNDISProperty(OID_GEN_CURRENT_PACKET_FILTER,
|
||||
&RetrievedPacketFilter, sizeof(RetrievedPacketFilter))) != HOST_SENDCONTROL_Successful)
|
||||
{
|
||||
printf_P(PSTR(ESC_FG_RED "Error Getting Packet Filter.\r\n"
|
||||
" -- Error Code: %d\r\n" ESC_FG_WHITE), ErrorCode);
|
||||
|
||||
/* Indicate error via status LEDs */
|
||||
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
|
||||
|
||||
/* Wait until USB device disconnected */
|
||||
USB_HostState = HOST_STATE_WaitForDeviceRemoval;
|
||||
break;
|
||||
}
|
||||
|
||||
if (RetrievedPacketFilter != PacketFilter)
|
||||
printf("ERROR: Retrieved Packet Filter %08lx != Set Packet Filter %08lx!\r\n", RetrievedPacketFilter, PacketFilter);
|
||||
|
||||
uint32_t VendorID;
|
||||
if ((ErrorCode = RNDIS_QueryRNDISProperty(OID_GEN_VENDOR_ID,
|
||||
&VendorID, sizeof(VendorID))) != HOST_SENDCONTROL_Successful)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue