rmman problem
Posted: Thu Jun 16, 2005 4:20 pm
i'm trying to use librm to read returns from my remote but i couldn't get anything just zeroes, i tried also inserting a printf inside the library to see what it get and i get only this: 10a580 either by pressing and not pressing buttons
this is what i do:
all the irxs are loaded successfully, rmman is initialized successfully (ret = 1) and it get version 265.
rmmanopen also returns 1
but in the struct datarem i get only zeroes and if i do this in the source of the lib:
i get only 10a580 from that printf.
thanks in advance of the help :)
this is what i do:
Code: Select all
char paddata[256] __attribute__((aligned(64))); //the controller buffer
int main()
{
SifInitRpc(0);
init_scr();
struct remote_data * datarem;
datarem = malloc(sizeof(struct remote_data));
SifLoadModule("rom0:ADDDRV", 0, NULL);
SifLoadModule("rom1:SIO2MAN", 0, NULL);
SifLoadModule("rom1:RMMAN", 0, NULL);
RMMan_Init();
RMMan_Open(0, 0, paddata);
while(1)
{
RMMan_Read(0, 0,datarem);
//check returns and print if new things appened :)
printf("data_status = %x, data_button = %x, paddata: %s\n",datarem->status,datarem->button,paddata);
if(datarem->status == RM_KEYPRESSED)
{
scr_printf("return of the remote : %x\n", datarem->button);
}
}
return 0;
}
rmmanopen also returns 1
but in the struct datarem i get only zeroes and if i do this in the source of the lib:
Code: Select all
void RMMan_Read(int port, int slot, struct remote_data *data)
{
struct rm_data *pdata;
if((port < 0) || (port > 1) || (slot != 0))
{
printf("Error, port must be 0 or 1 and slot set to 0\n");
return;
}
pdata = rmGetDmaStr(port, slot);
printf("%x\n",pdata->data); //what i added
memcpy(data, pdata->data, 8);
}
thanks in advance of the help :)