All Class Driver Host mode demos now correctly set the board LEDs to READY once the enumeration process has completed.

Fixed Still Image Host class driver not resetting the transaction ID when a new session is opened, fixed driver not sending a valid session ID to the device.
This commit is contained in:
Dean Camera 2010-03-25 06:34:38 +00:00
parent b8db5fc1e7
commit 74353374c3
21 changed files with 34 additions and 21 deletions

View file

@ -315,12 +315,15 @@ uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
uint8_t ErrorCode;
SIInterfaceInfo->State.TransactionID = 0;
SIInterfaceInfo->State.IsSessionOpen = false;
SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t)
{
.DataLength = PIMA_COMMAND_SIZE(0),
.DataLength = PIMA_COMMAND_SIZE(1),
.Type = CType_CommandBlock,
.Code = 0x1002,
.Params = {},
.Params = {1},
};
if ((ErrorCode = SImage_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)
@ -332,7 +335,6 @@ uint8_t SImage_Host_OpenSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
if ((PIMABlock.Type != CType_ResponseBlock) || (PIMABlock.Code != 0x2001))
return SI_ERROR_LOGICAL_CMD_FAILED;
SIInterfaceInfo->State.TransactionID = 0;
SIInterfaceInfo->State.IsSessionOpen = true;
return PIPE_RWSTREAM_NoError;
@ -347,10 +349,10 @@ uint8_t SImage_Host_CloseSession(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo)
SI_PIMA_Container_t PIMABlock = (SI_PIMA_Container_t)
{
.DataLength = PIMA_COMMAND_SIZE(0),
.DataLength = PIMA_COMMAND_SIZE(1),
.Type = CType_CommandBlock,
.Code = 0x1003,
.Params = {},
.Params = {1},
};
if ((ErrorCode = SImage_Host_SendBlockHeader(SIInterfaceInfo, &PIMABlock)) != PIPE_RWSTREAM_NoError)