Hi all,
  Am trying to create my own proxy server that uses the opaque interface to send and recieve requests and data. I created a common header file that defines the requests and the data structures as follows:

#ifndef COMMON_H_
#define COMMON_H_

#define PLAYER_ROBOT_SOUND_HORN_REQ      ((uint8_t)1)
#define PLAYER_ROBOT_SET_MODE_REQ        ((uint8_t)2)
#define PLAYER_ROBOT_INC_GEAR_REQ        ((uint8_t)3)
#define PLAYER_ROBOT_DEC_GEAR_REQ        ((uint8_t)4)
#define PLAYER_ROBOT_SET_POWER_REQ       ((uint8_t)5)
#define PLAYER_ROBOT_GET_MODE_REQ        ((uint8_t)6)
#define PLAYER_ROBOT_GET_JOYX_REQ        ((uint8_t)7)
#define PLAYER_ROBOT_GET_JOYY_REQ        ((uint8_t)8)
#define PLAYER_ROBOT_GET_POWER_REQ       ((uint8_t)9)
#define ON 1
#define OFF 0
#define HORN_SLEEP 150000
#define UP 1
#define DOWN 0
#define AUTO 1 
#define MANUAL 0
#define INCREMENT 1 
#define DECREMENT 0
/******************* DATA STARTS******************************/
typedef struct playe_robot_data
{
 int32_t joyx, joyy;             // X and Y position of the joystick
 int16_t mode, power;        // mode, Auto or Manual; power, On or Off
} __attribute__ ((packed)) player_robot_data_t;
/******************* DATA ENDS*******************************/

/******************* COMMAND STARTS************************/
typedef struct player_robot_speed_cmd
{
   int32_t xpos, ypos;                // X and Y position
   int32_t xspeed,yspeed;         // Linear And Angular Velocity in m/sec and rad /sec
   int32_t yaw,yawspeed;          // angle and angular velocity in m/sec
   int32_t state,type;                 // state (ON,OFF) and type of command (Position Control or Speed Control)
} __attribute__ ((packed)) player_wheelchair_speed_cmd_t;
/******************* COMMAND ENDS************************/

/*******************CONFIG   STARTS************************/
typedef struct player_robot_config
{
  uint8_t request;
  uint16_t value;
} __attribute__ ((packed)) player_robot_config_t;
/*******************CONFIG      ENDS************************/
#endif




Then i modified the opaque c++ proxy to handle methods that i introduced like this :
/*****************************************************************************
 **                  Decrement Gear  Reguest Starts                          **
 *****************************************************************************/
int WheelChairProxy::DecrementGear(int gears)
{
    scoped_lock_t lock(mPc->mMutex);       
    if (gears >5 || gears < 1)
    {
        printf("\n    -->Gears Value can be between 1 and 5 only");
        return -1;
    }
    player_robot_config_t config;
    config.value = gears;
    config.request = PLAYER_ROBOT_DEC_GEAR_REQ;   
    if(playerc_client_request(mDevice->info.client, &mDevice->info,PLAYER_OPAQUE_REQ,
                            (void*)&config,  (void*)&config,sizeof(config)) < 0)   
        return -1;
    else
        return 0;
}
/*****************************************************************************
 **                      Set Power  Reguest Starts                          **
 *****************************************************************************/
int WheelChairProxy::SetPower(int state_to_set)
{
    scoped_lock_t lock(mPc->mMutex);       
    player_robot_config_t config;
    config.value = state_to_set;
    config.request = PLAYER_ROBOT_SET_POWER_REQ;
    if(playerc_client_request(mDevice->info.client, &mDevice->info,PLAYER_OPAQUE_REQ,
                            (void*)&config,  (void*)&config,sizeof(config)) < 0)   
        return -1;
    else
        return 0;
}

/*****************************************************************************
 **                      Set Mode   Reguest Starts                          **
 *****************************************************************************/
int WheelChairProxy::SetMode(int mode_to_set)
{    
    scoped_lock_t lock(mPc->mMutex);       
    player_robot_config_t config;
    config.value = mode_to_set;
    config.request = PLAYER_ROBOT_SET_MODE_REQ;
    if(playerc_client_request(mDevice->info.client, &mDevice->info,PLAYER_OPAQUE_REQ,
                           (void*)&config,  (void*)&config,sizeof(config)) < 0)                           
        return -1;
    else
        return 0;
}
/*****************************************************************************
 **           Get JOYSTICK  Y Position Request Starts                       **
 *****************************************************************************/
double WheelChairProxy::JoyY()
{
    scoped_lock_t lock(mPc->mMutex);       
    player_robot_config_t config;
    memset( &config, 0, sizeof(config) );
    config.request = PLAYER_ROBOT_GET_JOYY_REQ;       
    if(playerc_client_request(mDevice->info.client, &mDevice->info,PLAYER_OPAQUE_REQ,
                            NULL,  (void*)&config,sizeof(config)) < 0)   
        return -1;
    else
        return config.value;
}

But when i launch the client application, i got the error messege : " encoding failed on message from 51:0 with type 3:3" . It seems there is a check to prevent req_data being from being sent to the drive, becauce if i change the playerc_client_request(mDevice-> info.client, &mDevice->info,PLAYER_OPAQUE_REQ, NULL,  (void*)&config,sizeof(config))
                                                        to playerc_client_request(mDevice->info.client, &mDevice->info,PLAYER_OPAQUE_REQ, NULL,  (void*)&config,sizeof(config)) then the driver gets the request but it fails to direct it to the appropriate subtype that i usually add in the config.request. Is there a way of overcoming this ? It's useless to have the opaque interface without being able to custom define certain messege types and requests. I tired also to add the subtype directly to the playerc_client_request in place of the PLAYER_OPAQUE_REQ but the proxy also fails the check here :
    // Locate the appropriate packing function for the message body
    if(!(packfunc = playerxdr_get_func(header->addr.interf,
                                       header->type,
                                       header->subtype)))
    {
      // TODO: Allow the user to register a callback to handle unsupported
      // messages
      PLAYERC_ERR3("skipping message to %u:%u with unsupported type %u",
                   header-> addr.interf, header->addr.index, header->subtype);
      return(-1);
    }
which apparently limits the subtype that u can send with the opaque interface to the default ones. Is there any other thing that i can try to be able to send custom messeges and requests. I would appreciate any suggestions.

Regards,
Tarek Taha