Commit f555ad7c authored by Dean Camera's avatar Dean Camera
Browse files

Altered all endpoint/pipe stream transfers so that the new BytesProcessed...

Altered all endpoint/pipe stream transfers so that the new BytesProcessed parameter now points to a location where the number of bytes in the transfer that have been completed can be stored (or NULL if entire transaction should be performed in one chunk).

Added new Endpoint_Null_Stream() and Pipe_Null_stream() functions.

Removed the NO_STREAM_CALLBACKS compile time option due to the new partial stream transfer feature replacing it.

Fixed errors in the incomplete Test and Measurement device demo preventing proper operation (thanks to Pavel Plotnikov).
parent 477a2047
...@@ -122,7 +122,6 @@ LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENAB ...@@ -122,7 +122,6 @@ LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENAB
LUFA_OPTS += -D NO_INTERNAL_SERIAL LUFA_OPTS += -D NO_INTERNAL_SERIAL
LUFA_OPTS += -D NO_DEVICE_SELF_POWER LUFA_OPTS += -D NO_DEVICE_SELF_POWER
LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_SOF_EVENTS LUFA_OPTS += -D NO_SOF_EVENTS
#LUFA_OPTS += -D NO_BLOCK_SUPPORT #LUFA_OPTS += -D NO_BLOCK_SUPPORT
......
...@@ -122,7 +122,6 @@ LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENAB ...@@ -122,7 +122,6 @@ LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENAB
LUFA_OPTS += -D NO_INTERNAL_SERIAL LUFA_OPTS += -D NO_INTERNAL_SERIAL
LUFA_OPTS += -D NO_DEVICE_SELF_POWER LUFA_OPTS += -D NO_DEVICE_SELF_POWER
LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP LUFA_OPTS += -D NO_DEVICE_REMOTE_WAKEUP
LUFA_OPTS += -D NO_STREAM_CALLBACKS
LUFA_OPTS += -D NO_SOF_EVENTS LUFA_OPTS += -D NO_SOF_EVENTS
......
...@@ -169,12 +169,10 @@ static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* const MSInterfaceInf ...@@ -169,12 +169,10 @@ static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
return false; return false;
} }
Endpoint_Write_Stream_LE(&InquiryData, BytesTransferred, NO_STREAM_CALLBACK); Endpoint_Write_Stream_LE(&InquiryData, BytesTransferred, NULL);
uint8_t PadBytes[AllocationLength - BytesTransferred];
/* Pad out remaining bytes with 0x00 */ /* Pad out remaining bytes with 0x00 */
Endpoint_Write_Stream_LE(&PadBytes, sizeof(PadBytes), NO_STREAM_CALLBACK); Endpoint_Null_Stream((AllocationLength - BytesTransferred), NULL);
/* Finalize the stream transfer to send the last packet */ /* Finalize the stream transfer to send the last packet */
Endpoint_ClearIN(); Endpoint_ClearIN();
...@@ -197,10 +195,8 @@ static bool SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* const MSInterf ...@@ -197,10 +195,8 @@ static bool SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* const MSInterf
uint8_t AllocationLength = MSInterfaceInfo->State.CommandBlock.SCSICommandData[4]; uint8_t AllocationLength = MSInterfaceInfo->State.CommandBlock.SCSICommandData[4];
uint8_t BytesTransferred = (AllocationLength < sizeof(SenseData))? AllocationLength : sizeof(SenseData); uint8_t BytesTransferred = (AllocationLength < sizeof(SenseData))? AllocationLength : sizeof(SenseData);
uint8_t PadBytes[AllocationLength - BytesTransferred]; Endpoint_Write_Stream_LE(&SenseData, BytesTransferred, NULL);
Endpoint_Null_Stream((AllocationLength - BytesTransferred), NULL);
Endpoint_Write_Stream_LE(&SenseData, BytesTransferred, NO_STREAM_CALLBACK);
Endpoint_Write_Stream_LE(&PadBytes, sizeof(PadBytes), NO_STREAM_CALLBACK);
Endpoint_ClearIN(); Endpoint_ClearIN();
/* Succeed the command and update the bytes transferred counter */ /* Succeed the command and update the bytes transferred counter */
...@@ -221,8 +217,8 @@ static bool SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* const MSInt ...@@ -221,8 +217,8 @@ static bool SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* const MSInt
uint32_t LastBlockAddressInLUN = (LUN_MEDIA_BLOCKS - 1); uint32_t LastBlockAddressInLUN = (LUN_MEDIA_BLOCKS - 1);
uint32_t MediaBlockSize = VIRTUAL_MEMORY_BLOCK_SIZE; uint32_t MediaBlockSize = VIRTUAL_MEMORY_BLOCK_SIZE;
Endpoint_Write_Stream_BE(&LastBlockAddressInLUN, sizeof(LastBlockAddressInLUN), NO_STREAM_CALLBACK); Endpoint_Write_Stream_BE(&LastBlockAddressInLUN, sizeof(LastBlockAddressInLUN), NULL);
Endpoint_Write_Stream_BE(&MediaBlockSize, sizeof(MediaBlockSize), NO_STREAM_CALLBACK); Endpoint_Write_Stream_BE(&MediaBlockSize, sizeof(MediaBlockSize), NULL);
Endpoint_ClearIN(); Endpoint_ClearIN();
/* Succeed the command and update the bytes transferred counter */ /* Succeed the command and update the bytes transferred counter */
......
...@@ -169,12 +169,10 @@ static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* const MSInterfaceInf ...@@ -169,12 +169,10 @@ static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
return false; return false;
} }
Endpoint_Write_Stream_LE(&InquiryData, BytesTransferred, NO_STREAM_CALLBACK); Endpoint_Write_Stream_LE(&InquiryData, BytesTransferred, NULL);
uint8_t PadBytes[AllocationLength - BytesTransferred];
/* Pad out remaining bytes with 0x00 */ /* Pad out remaining bytes with 0x00 */
Endpoint_Write_Stream_LE(&PadBytes, sizeof(PadBytes), NO_STREAM_CALLBACK); Endpoint_Null_Stream((AllocationLength - BytesTransferred), NULL);
/* Finalize the stream transfer to send the last packet */ /* Finalize the stream transfer to send the last packet */
Endpoint_ClearIN(); Endpoint_ClearIN();
...@@ -197,10 +195,8 @@ static bool SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* const MSInterf ...@@ -197,10 +195,8 @@ static bool SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* const MSInterf
uint8_t AllocationLength = MSInterfaceInfo->State.CommandBlock.SCSICommandData[4]; uint8_t AllocationLength = MSInterfaceInfo->State.CommandBlock.SCSICommandData[4];
uint8_t BytesTransferred = (AllocationLength < sizeof(SenseData))? AllocationLength : sizeof(SenseData); uint8_t BytesTransferred = (AllocationLength < sizeof(SenseData))? AllocationLength : sizeof(SenseData);
uint8_t PadBytes[AllocationLength - BytesTransferred]; Endpoint_Write_Stream_LE(&SenseData, BytesTransferred, NULL);
Endpoint_Null_Stream((AllocationLength - BytesTransferred), NULL);
Endpoint_Write_Stream_LE(&SenseData, BytesTransferred, NO_STREAM_CALLBACK);
Endpoint_Write_Stream_LE(&PadBytes, sizeof(PadBytes), NO_STREAM_CALLBACK);
Endpoint_ClearIN(); Endpoint_ClearIN();
/* Succeed the command and update the bytes transferred counter */ /* Succeed the command and update the bytes transferred counter */
...@@ -221,8 +217,8 @@ static bool SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* const MSInt ...@@ -221,8 +217,8 @@ static bool SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* const MSInt
uint32_t LastBlockAddressInLUN = (LUN_MEDIA_BLOCKS - 1); uint32_t LastBlockAddressInLUN = (LUN_MEDIA_BLOCKS - 1);
uint32_t MediaBlockSize = VIRTUAL_MEMORY_BLOCK_SIZE; uint32_t MediaBlockSize = VIRTUAL_MEMORY_BLOCK_SIZE;
Endpoint_Write_Stream_BE(&LastBlockAddressInLUN, sizeof(LastBlockAddressInLUN), NO_STREAM_CALLBACK); Endpoint_Write_Stream_BE(&LastBlockAddressInLUN, sizeof(LastBlockAddressInLUN), NULL);
Endpoint_Write_Stream_BE(&MediaBlockSize, sizeof(MediaBlockSize), NO_STREAM_CALLBACK); Endpoint_Write_Stream_BE(&MediaBlockSize, sizeof(MediaBlockSize), NULL);
Endpoint_ClearIN(); Endpoint_ClearIN();
/* Succeed the command and update the bytes transferred counter */ /* Succeed the command and update the bytes transferred counter */
......
...@@ -48,7 +48,7 @@ void Sideshow_ProcessCommandPacket(void) ...@@ -48,7 +48,7 @@ void Sideshow_ProcessCommandPacket(void)
SideShow_PacketHeader_t PacketHeader; SideShow_PacketHeader_t PacketHeader;
Endpoint_SelectEndpoint(SIDESHOW_OUT_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_OUT_EPNUM);
Endpoint_Read_Stream_LE(&PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Read_Stream_LE(&PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
PacketHeader.Type.TypeFields.Response = true; PacketHeader.Type.TypeFields.Response = true;
...@@ -104,14 +104,14 @@ void Sideshow_ProcessCommandPacket(void) ...@@ -104,14 +104,14 @@ void Sideshow_ProcessCommandPacket(void)
default: default:
PacketHeader.Length -= sizeof(SideShow_PacketHeader_t); PacketHeader.Length -= sizeof(SideShow_PacketHeader_t);
Endpoint_Discard_Stream(PacketHeader.Length); Endpoint_Discard_Stream(PacketHeader.Length, NULL);
Endpoint_ClearOUT(); Endpoint_ClearOUT();
PacketHeader.Length = sizeof(SideShow_PacketHeader_t); PacketHeader.Length = sizeof(SideShow_PacketHeader_t);
PacketHeader.Type.TypeFields.NAK = true; PacketHeader.Type.TypeFields.NAK = true;
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(&PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(&PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN(); Endpoint_ClearIN();
printf(" UNK"); printf(" UNK");
...@@ -123,7 +123,7 @@ static void SideShow_Ping(SideShow_PacketHeader_t* const PacketHeader) ...@@ -123,7 +123,7 @@ static void SideShow_Ping(SideShow_PacketHeader_t* const PacketHeader)
Endpoint_ClearOUT(); Endpoint_ClearOUT();
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN(); Endpoint_ClearIN();
} }
...@@ -131,15 +131,15 @@ static void SideShow_Sync(SideShow_PacketHeader_t* const PacketHeader) ...@@ -131,15 +131,15 @@ static void SideShow_Sync(SideShow_PacketHeader_t* const PacketHeader)
{ {
GUID_t ProtocolGUID; GUID_t ProtocolGUID;
Endpoint_Read_Stream_LE(&ProtocolGUID, sizeof(GUID_t)); Endpoint_Read_Stream_LE(&ProtocolGUID, sizeof(GUID_t), NULL);
Endpoint_ClearOUT(); Endpoint_ClearOUT();
if (!(GUID_COMPARE(&ProtocolGUID, (uint32_t[])STANDARD_PROTOCOL_GUID))) if (!(GUID_COMPARE(&ProtocolGUID, (uint32_t[])STANDARD_PROTOCOL_GUID)))
PacketHeader->Type.TypeFields.NAK = true; PacketHeader->Type.TypeFields.NAK = true;
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_Write_Stream_LE(&ProtocolGUID, sizeof(GUID_t)); Endpoint_Write_Stream_LE(&ProtocolGUID, sizeof(GUID_t), NULL);
Endpoint_ClearIN(); Endpoint_ClearIN();
} }
...@@ -150,7 +150,7 @@ static void SideShow_GetCurrentUser(SideShow_PacketHeader_t* const PacketHeader) ...@@ -150,7 +150,7 @@ static void SideShow_GetCurrentUser(SideShow_PacketHeader_t* const PacketHeader)
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) + sizeof(uint32_t) + UserSID.LengthInBytes; PacketHeader->Length = sizeof(SideShow_PacketHeader_t) + sizeof(uint32_t) + UserSID.LengthInBytes;
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
SideShow_Write_Unicode_String(&UserSID); SideShow_Write_Unicode_String(&UserSID);
Endpoint_ClearIN(); Endpoint_ClearIN();
} }
...@@ -163,7 +163,7 @@ static void SideShow_SetCurrentUser(SideShow_PacketHeader_t* const PacketHeader) ...@@ -163,7 +163,7 @@ static void SideShow_SetCurrentUser(SideShow_PacketHeader_t* const PacketHeader)
PacketHeader->Length = sizeof(SideShow_PacketHeader_t); PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN(); Endpoint_ClearIN();
} }
...@@ -172,7 +172,7 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* const PacketHeader ...@@ -172,7 +172,7 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* const PacketHeader
SideShow_PropertyKey_t Property; SideShow_PropertyKey_t Property;
SideShow_PropertyData_t PropertyData; SideShow_PropertyData_t PropertyData;
Endpoint_Read_Stream_LE(&Property, sizeof(SideShow_PropertyKey_t)); Endpoint_Read_Stream_LE(&Property, sizeof(SideShow_PropertyKey_t), NULL);
Endpoint_ClearOUT(); Endpoint_ClearOUT();
printf(" ID: %lu", Property.PropertyID); printf(" ID: %lu", Property.PropertyID);
...@@ -255,7 +255,7 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* const PacketHeader ...@@ -255,7 +255,7 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* const PacketHeader
} }
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
if (!(PacketHeader->Type.TypeFields.NAK)) if (!(PacketHeader->Type.TypeFields.NAK))
{ {
...@@ -263,12 +263,12 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* const PacketHeader ...@@ -263,12 +263,12 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* const PacketHeader
{ {
case VT_UI4: case VT_UI4:
case VT_I4: case VT_I4:
Endpoint_Write_Stream_LE(&PropertyData.Data.Data32, sizeof(uint32_t)); Endpoint_Write_Stream_LE(&PropertyData.Data.Data32, sizeof(uint32_t), NULL);
break; break;
case VT_UI2: case VT_UI2:
case VT_I2: case VT_I2:
case VT_BOOL: case VT_BOOL:
Endpoint_Write_Stream_LE(&PropertyData.Data.Data16, sizeof(uint16_t)); Endpoint_Write_Stream_LE(&PropertyData.Data.Data16, sizeof(uint16_t), NULL);
break; break;
case VT_LPWSTR: case VT_LPWSTR:
SideShow_Write_Unicode_String((Unicode_String_t*)PropertyData.Data.Data16); SideShow_Write_Unicode_String((Unicode_String_t*)PropertyData.Data.Data16);
...@@ -289,7 +289,7 @@ static void SideShow_GetString(SideShow_PacketHeader_t* const PacketHeader, ...@@ -289,7 +289,7 @@ static void SideShow_GetString(SideShow_PacketHeader_t* const PacketHeader,
sizeof(uint32_t) + ((Unicode_String_t*)UnicodeStruct)->LengthInBytes; sizeof(uint32_t) + ((Unicode_String_t*)UnicodeStruct)->LengthInBytes;
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
SideShow_Write_Unicode_String(UnicodeStruct); SideShow_Write_Unicode_String(UnicodeStruct);
Endpoint_ClearIN(); Endpoint_ClearIN();
} }
...@@ -310,13 +310,13 @@ static void SideShow_GetApplicationOrder(SideShow_PacketHeader_t* const PacketHe ...@@ -310,13 +310,13 @@ static void SideShow_GetApplicationOrder(SideShow_PacketHeader_t* const PacketHe
sizeof(uint32_t) + (TotalApplications * sizeof(GUID_t)); sizeof(uint32_t) + (TotalApplications * sizeof(GUID_t));
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_Write_DWord_LE(TotalApplications); Endpoint_Write_DWord_LE(TotalApplications);
for (uint8_t App = 0; App < MAX_APPLICATIONS; App++) for (uint8_t App = 0; App < MAX_APPLICATIONS; App++)
{ {
if (InstalledApplications[App].InUse) if (InstalledApplications[App].InUse)
Endpoint_Write_Stream_LE(&InstalledApplications[App].ApplicationID, sizeof(GUID_t)); Endpoint_Write_Stream_LE(&InstalledApplications[App].ApplicationID, sizeof(GUID_t), NULL);
} }
Endpoint_ClearIN(); Endpoint_ClearIN();
...@@ -331,9 +331,9 @@ static void SideShow_GetSupportedEndpoints(SideShow_PacketHeader_t* const Packet ...@@ -331,9 +331,9 @@ static void SideShow_GetSupportedEndpoints(SideShow_PacketHeader_t* const Packet
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) + sizeof(uint32_t) + sizeof(GUID_t); PacketHeader->Length = sizeof(SideShow_PacketHeader_t) + sizeof(uint32_t) + sizeof(GUID_t);
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_Write_DWord_LE(1); Endpoint_Write_DWord_LE(1);
Endpoint_Write_Stream_LE(&SupportedEndpointGUID, sizeof(GUID_t)); Endpoint_Write_Stream_LE(&SupportedEndpointGUID, sizeof(GUID_t), NULL);
Endpoint_ClearIN(); Endpoint_ClearIN();
} }
...@@ -342,7 +342,7 @@ static void SideShow_AddApplication(SideShow_PacketHeader_t* const PacketHeader) ...@@ -342,7 +342,7 @@ static void SideShow_AddApplication(SideShow_PacketHeader_t* const PacketHeader)
SideShow_Application_t* CurrApp; SideShow_Application_t* CurrApp;
GUID_t ApplicationID; GUID_t ApplicationID;
Endpoint_Read_Stream_LE(&ApplicationID, sizeof(GUID_t)); Endpoint_Read_Stream_LE(&ApplicationID, sizeof(GUID_t), NULL);
CurrApp = SideShow_GetApplicationFromGUID(&ApplicationID); CurrApp = SideShow_GetApplicationFromGUID(&ApplicationID);
...@@ -353,7 +353,7 @@ static void SideShow_AddApplication(SideShow_PacketHeader_t* const PacketHeader) ...@@ -353,7 +353,7 @@ static void SideShow_AddApplication(SideShow_PacketHeader_t* const PacketHeader)
{ {
PacketHeader->Length -= sizeof(SideShow_PacketHeader_t) + sizeof(GUID_t); PacketHeader->Length -= sizeof(SideShow_PacketHeader_t) + sizeof(GUID_t);
Endpoint_Discard_Stream(PacketHeader->Length); Endpoint_Discard_Stream(PacketHeader->Length, NULL);
Endpoint_ClearOUT(); Endpoint_ClearOUT();
PacketHeader->Type.TypeFields.NAK = true; PacketHeader->Type.TypeFields.NAK = true;
...@@ -361,10 +361,10 @@ static void SideShow_AddApplication(SideShow_PacketHeader_t* const PacketHeader) ...@@ -361,10 +361,10 @@ static void SideShow_AddApplication(SideShow_PacketHeader_t* const PacketHeader)
else else
{ {
CurrApp->ApplicationID = ApplicationID; CurrApp->ApplicationID = ApplicationID;
Endpoint_Read_Stream_LE(&CurrApp->EndpointID, sizeof(GUID_t)); Endpoint_Read_Stream_LE(&CurrApp->EndpointID, sizeof(GUID_t), NULL);
SideShow_Read_Unicode_String(&CurrApp->ApplicationName, sizeof(CurrApp->ApplicationName.UnicodeString)); SideShow_Read_Unicode_String(&CurrApp->ApplicationName, sizeof(CurrApp->ApplicationName.UnicodeString));
Endpoint_Read_Stream_LE(&CurrApp->CachePolicy, sizeof(uint32_t)); Endpoint_Read_Stream_LE(&CurrApp->CachePolicy, sizeof(uint32_t), NULL);
Endpoint_Read_Stream_LE(&CurrApp->OnlineOnly, sizeof(uint32_t)); Endpoint_Read_Stream_LE(&CurrApp->OnlineOnly, sizeof(uint32_t), NULL);
SideShow_Discard_Byte_Stream(); SideShow_Discard_Byte_Stream();
SideShow_Discard_Byte_Stream(); SideShow_Discard_Byte_Stream();
SideShow_Discard_Byte_Stream(); SideShow_Discard_Byte_Stream();
...@@ -378,7 +378,7 @@ static void SideShow_AddApplication(SideShow_PacketHeader_t* const PacketHeader) ...@@ -378,7 +378,7 @@ static void SideShow_AddApplication(SideShow_PacketHeader_t* const PacketHeader)
PacketHeader->Length = sizeof(SideShow_PacketHeader_t); PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN(); Endpoint_ClearIN();
} }
...@@ -386,7 +386,7 @@ static void SideShow_DeleteApplication(SideShow_PacketHeader_t* const PacketHead ...@@ -386,7 +386,7 @@ static void SideShow_DeleteApplication(SideShow_PacketHeader_t* const PacketHead
{ {
GUID_t ApplicationGUID; GUID_t ApplicationGUID;
Endpoint_Read_Stream_LE(&ApplicationGUID, sizeof(GUID_t)); Endpoint_Read_Stream_LE(&ApplicationGUID, sizeof(GUID_t), NULL);
Endpoint_ClearOUT(); Endpoint_ClearOUT();
SideShow_Application_t* AppToDelete = SideShow_GetApplicationFromGUID(&ApplicationGUID); SideShow_Application_t* AppToDelete = SideShow_GetApplicationFromGUID(&ApplicationGUID);
...@@ -399,7 +399,7 @@ static void SideShow_DeleteApplication(SideShow_PacketHeader_t* const PacketHead ...@@ -399,7 +399,7 @@ static void SideShow_DeleteApplication(SideShow_PacketHeader_t* const PacketHead
PacketHeader->Length = sizeof(SideShow_PacketHeader_t); PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN(); Endpoint_ClearIN();
} }
...@@ -411,7 +411,7 @@ static void SideShow_DeleteAllApplications(SideShow_PacketHeader_t* const Packet ...@@ -411,7 +411,7 @@ static void SideShow_DeleteAllApplications(SideShow_PacketHeader_t* const Packet
InstalledApplications[App].InUse = false; InstalledApplications[App].InUse = false;
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN(); Endpoint_ClearIN();
} }
...@@ -421,8 +421,8 @@ static void SideShow_AddContent(SideShow_PacketHeader_t* const PacketHeader) ...@@ -421,8 +421,8 @@ static void SideShow_AddContent(SideShow_PacketHeader_t* const PacketHeader)
GUID_t EndpointID; GUID_t EndpointID;
SideShow_Application_t* Application; SideShow_Application_t* Application;
Endpoint_Read_Stream_LE(&ApplicationID, sizeof(GUID_t)); Endpoint_Read_Stream_LE(&ApplicationID, sizeof(GUID_t), NULL);
Endpoint_Read_Stream_LE(&EndpointID, sizeof(GUID_t)); Endpoint_Read_Stream_LE(&EndpointID, sizeof(GUID_t), NULL);
Application = SideShow_GetApplicationFromGUID(&ApplicationID); Application = SideShow_GetApplicationFromGUID(&ApplicationID);
...@@ -441,7 +441,7 @@ static void SideShow_AddContent(SideShow_PacketHeader_t* const PacketHeader) ...@@ -441,7 +441,7 @@ static void SideShow_AddContent(SideShow_PacketHeader_t* const PacketHeader)
PacketHeader->Length = sizeof(SideShow_PacketHeader_t); PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN(); Endpoint_ClearIN();
} }
...@@ -451,9 +451,9 @@ static void SideShow_DeleteContent(SideShow_PacketHeader_t* const PacketHeader) ...@@ -451,9 +451,9 @@ static void SideShow_DeleteContent(SideShow_PacketHeader_t* const PacketHeader)
GUID_t EndpointID; GUID_t EndpointID;
uint32_t ContentID; uint32_t ContentID;
Endpoint_Read_Stream_LE(&ApplicationID, sizeof(GUID_t)); Endpoint_Read_Stream_LE(&ApplicationID, sizeof(GUID_t), NULL);
Endpoint_Read_Stream_LE(&EndpointID, sizeof(GUID_t)); Endpoint_Read_Stream_LE(&EndpointID, sizeof(GUID_t), NULL);
Endpoint_Read_Stream_LE(&ContentID, sizeof(uint32_t)); Endpoint_Read_Stream_LE(&ContentID, sizeof(uint32_t), NULL);
Endpoint_ClearOUT(); Endpoint_ClearOUT();
SideShow_Application_t* Application = SideShow_GetApplicationFromGUID(&ApplicationID); SideShow_Application_t* Application = SideShow_GetApplicationFromGUID(&ApplicationID);
...@@ -466,7 +466,7 @@ static void SideShow_DeleteContent(SideShow_PacketHeader_t* const PacketHeader) ...@@ -466,7 +466,7 @@ static void SideShow_DeleteContent(SideShow_PacketHeader_t* const PacketHeader)
PacketHeader->Length = sizeof(SideShow_PacketHeader_t); PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN(); Endpoint_ClearIN();
} }
...@@ -475,8 +475,8 @@ static void SideShow_DeleteAllContent(SideShow_PacketHeader_t* const PacketHeade ...@@ -475,8 +475,8 @@ static void SideShow_DeleteAllContent(SideShow_PacketHeader_t* const PacketHeade
GUID_t ApplicationID; GUID_t ApplicationID;
GUID_t EndpointID; GUID_t EndpointID;
Endpoint_Read_Stream_LE(&ApplicationID, sizeof(GUID_t)); Endpoint_Read_Stream_LE(&ApplicationID, sizeof(GUID_t), NULL);
Endpoint_Read_Stream_LE(&EndpointID, sizeof(GUID_t)); Endpoint_Read_Stream_LE(&EndpointID, sizeof(GUID_t), NULL);
Endpoint_ClearOUT(); Endpoint_ClearOUT();
SideShow_Application_t* Application = SideShow_GetApplicationFromGUID(&ApplicationID); SideShow_Application_t* Application = SideShow_GetApplicationFromGUID(&ApplicationID);
...@@ -489,7 +489,7 @@ static void SideShow_DeleteAllContent(SideShow_PacketHeader_t* const PacketHeade ...@@ -489,7 +489,7 @@ static void SideShow_DeleteAllContent(SideShow_PacketHeader_t* const PacketHeade
PacketHeader->Length = sizeof(SideShow_PacketHeader_t); PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM); Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t)); Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN(); Endpoint_ClearIN();
} }
...@@ -36,13 +36,13 @@ uint16_t SideShow_Read_Unicode_String(void* const UnicodeString, ...@@ -36,13 +36,13 @@ uint16_t SideShow_Read_Unicode_String(void* const UnicodeString,
Unicode_String_t* const UnicodeStruct = (Unicode_String_t*)UnicodeString; Unicode_String_t* const UnicodeStruct = (Unicode_String_t*)UnicodeString;
uint32_t UnicodeCharsToRead; uint32_t UnicodeCharsToRead;
Endpoint_Read_Stream_LE(&UnicodeCharsToRead, sizeof(uint32_t)); Endpoint_Read_Stream_LE(&UnicodeCharsToRead, sizeof(uint32_t), NULL);
int UnicodeData[UnicodeCharsToRead]; int UnicodeData[UnicodeCharsToRead];
UnicodeStruct->LengthInBytes = (UnicodeCharsToRead << 1); UnicodeStruct->LengthInBytes = (UnicodeCharsToRead << 1);
Endpoint_Read_Stream_LE(&UnicodeData, UnicodeStruct->LengthInBytes); Endpoint_Read_Stream_LE(&UnicodeData, UnicodeStruct->LengthInBytes, NULL);
if (UnicodeStruct->LengthInBytes > MaxBytes) if (UnicodeStruct->LengthInBytes > MaxBytes)
UnicodeStruct->LengthInBytes = MaxBytes; UnicodeStruct->LengthInBytes = MaxBytes;
...@@ -58,15 +58,15 @@ void SideShow_Write_Unicode_String(void* const UnicodeString) ...@@ -58,15 +58,15 @@ void SideShow_Write_Unicode_String(void* const UnicodeString)
uint32_t StringSizeInCharacters = (UnicodeStruct->LengthInBytes >> 1); uint32_t StringSizeInCharacters = (UnicodeStruct->LengthInBytes >> 1);
Endpoint_Write_Stream_LE(&StringSizeInCharacters, sizeof(uint32_t)); Endpoint_Write_Stream_LE(&StringSizeInCharacters, sizeof(uint32_t), NULL);
Endpoint_Write_Stream_LE(&UnicodeStruct->UnicodeString, UnicodeStruct->LengthInBytes); Endpoint_Write_Stream_LE(&UnicodeStruct->UnicodeString, UnicodeStruct->LengthInBytes, NULL);
} }
void SideShow_Discard_Byte_Stream(void) void SideShow_Discard_Byte_Stream(void)
{ {
uint32_t StreamSize; uint32_t StreamSize;
Endpoint_Read_Stream_LE(&StreamSize, sizeof(uint32_t)); Endpoint_Read_Stream_LE(&StreamSize, sizeof(uint32_t), NULL);
Endpoint_Discard_Stream(StreamSize); Endpoint_Discard_Stream(StreamSize, NULL);
} }
...@@ -37,19 +37,19 @@ bool SideShow_AddSimpleContent(SideShow_PacketHeader_t* const PacketHeader, ...@@ -37,19 +37,19 @@ bool SideShow_AddSimpleContent(SideShow_PacketHeader_t* const PacketHeader,
uint32_t ContentSize;