/*
*
*/
/*
*
*/
/* Command / ( / ) */
case A2_COMMAND(FALSE, , ):
{
if (0 != PayloadSize)
{
}
ReturnValue = (Session);
}
break;
/* Response to / ( / ) */
case A2_COMMAND(TRUE, , ):
{
ResponseStatus = (ErrorCode_e)Serialization::get_uint16_le(&Data_p);
PayloadSize -= 2;
if (E_SUCCESS == ResponseStatus)
{
}
ReturnValue = (Session, ResponseStatus);
}
break;
/* $Copyright ST-Ericsson 2010$ */
/* NOTE: This is an automatically generated file. DO NOT EDIT! */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Serialization.h"
#include "a2_commands_impl.h"
#include "t_a2_protocol.h"
//#include "a2_custom_commands.h" //when customer commands will be implemented
#include "LCDriverMethods.h"
#define A2_COMMAND(response, group, id) ((((int)(response)) << 30) | (((int)(group)) << 16) | ((int)(id)))
#define A2_COMMANDDATA(TypeP,ApplicationP,CommandP,SessionP,SizeP) \
memset((uint8*)&CmdData, 0x00, sizeof(A2_CommandData_t)); \
CmdData.Type = TypeP; \
CmdData.ApplicationNr = ApplicationP; \
CmdData.CommandNr = CommandP; \
CmdData.SessionNr = SessionP; \
CmdData.Payload.Size = SizeP; \
CmdData.Payload.Data_p = NULL; \
if(SizeP != 0)\
{ \
CmdData.Payload.Data_p = (uint8*)malloc(sizeof(ErrorCode_e) + SizeP); \
if(NULL == CmdData.Payload.Data_p) \
{ \
return E_ALLOCATE_FAILED; \
}\
}
#define A2_COMMANDDATAOUT(TypeP,ApplicationP,CommandP,SessionP,SizeP,TargetCPU) \
memset((uint8*)&CmdData, 0x00, sizeof(A2_CommandData_t)); \
CmdData.Type = TypeP; \
CmdData.ApplicationNr = ApplicationP; \
CmdData.CommandNr = CommandP; \
CmdData.SessionNr = SessionP; \
CmdData.Payload.Size = SizeP; \
CmdData.Payload.Data_p = NULL; \
CmdData.DestAddress = TargetCPU; \
if(SizeP != 0) \
{ \
CmdData.Payload.Data_p = (uint8*)malloc(SizeP); \
if(NULL == CmdData.Payload.Data_p) \
{ \
return E_ALLOCATE_FAILED; \
} \
}
ErrorCode_e A2LoaderRpcInterfaceImpl::Do_CEH_Callback(CommandData_t* pCmdData)
{
A2_CommandData_t* CmdData_p = (A2_CommandData_t*)pCmdData;
ErrorCode_e ReturnValue = E_GENERAL_FATAL_ERROR;
ErrorCode_e ResponseStatus = E_GENERAL_FATAL_ERROR;
boolean response = FALSE;
const void *Data_p = CmdData_p->Payload.Data_p;
uint32 PayloadSize = CmdData_p->Payload.Size;
uint16 Session = CmdData_p->SessionNr;
if (A2_GENERAL_RESPONSE == CmdData_p->Type)
{
// skip fields already handled by LCM: command group, 0xFF, more packets and original command
Data_p = ((uint8*)Data_p) + 4;
PayloadSize -= 4;
response = TRUE;
}
else if (A2_COMMAND == CmdData_p->Type)
{
// skip fields already handled by LCM: command group, command and more packets fields
Data_p = ((uint8*)Data_p) + 3;
PayloadSize -= 3;
response = FALSE;
}
else if (A2_CONTROL_MESSAGE == CmdData_p->Type)
{
// skip control message ID
Data_p = ((uint8*)Data_p) + 1;
PayloadSize -= 1;
response = FALSE;
}
else if (A2_SPEEDFLASH_GR == CmdData_p->Type)
{
uint16 Status = Serialization::get_uint16_le(&Data_p);
lcdMethods_->AddEvent(new Event(EVENT_SPEEDFLASH, Status));
return E_SUCCESS;
}
else
{
return E_GENERAL_FATAL_ERROR;
}
switch(A2_COMMAND(response, CmdData_p->ApplicationNr, CmdData_p->CommandNr))
{
default:
{
return E_COMMAND_NO_ERROR; // Do_CustomCEH_Call(CmdData_p); // when customer commands will be implemented
}
}
if (response)
{
lcdMethods_->AddEvent(new Event(EVENT_GR_RECEIVED, ResponseStatus, CmdData_p->ApplicationNr, CmdData_p->CommandNr));
}
else
{
lcdMethods_->AddEvent(new Event(EVENT_CMD_RECEIVED, 0, CmdData_p->ApplicationNr, CmdData_p->CommandNr));
}
return ReturnValue;
}
ErrorCode_e (uint16 SessionOut)
{
ErrorCode_e Answer;
A2_CommandData_t CmdData;
void *Data_p;
uint32 PLSize = 3;
A2_COMMANDDATAOUT(A2_COMMAND, , , SessionOut, PLSize, targetCpu_);
Data_p = CmdData.Payload.Data_p;
// set command group and command
Serialization::put_uint8(&Data_p, );
Serialization::put_uint8(&Data_p, );
// set more packets
Serialization::put_uint8(&Data_p, morePackets_);
Answer = lcmInterface_->A2CommandSend(&CmdData);
if(NULL != CmdData.Payload.Data_p)
free(CmdData.Payload.Data_p);
return Answer;
}
ErrorCode_e (uint16 Session)
{
ErrorCode_e Answer;
A2_CommandData_t CmdData;
void *Data_p;
uint32 PLSize = 0;
A2_COMMANDDATA(A2_GENERAL_RESPONSE, , , Session, PLSize);
Data_p = CmdData.Payload.Data_p;
Answer = lcmInterface_->A2CommandSend(&CmdData);
if(NULL != CmdData.Payload.Data_p)
free(CmdData.Payload.Data_p);
return Answer;
}