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
				
			
		| 
						 | 
				
			
			@ -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