Kuon/sw/bsModules/bsKuon/bsKuonClient.c
int bsKuonReqSetMotorSpeeds(BsClient_P   pClient,
                          BsVConnHnd_T hndVConn,
                          int          nSpeedLeft,
                          int          nSpeedRight)
{
  static BsKuonMsgId_T    msgIdReq = BsKuonMsgIdReqSetMotorSpeeds;
  static BsProxyMsgId_T   msgIdRsp = BsProxyMsgIdRspOk;

  BsKuonReqSetMotorSpeeds_T msgReq;                   // request message 
  byte_t                  buf[BSPROXY_MSG_MAX_LEN]; // req/rsp buffer
  bool_t                  bTrace;                   // do [not] trace messages
  int                     n;                        // num of bytes/return code

  //
  // Parameter checks.
  //
  BSCLIENT_TRY_EXPR(pClient, BSCLIENT_HAS_VCONN(pClient, hndVConn),
      BS_ECODE_BAD_VAL, "VConn=%d", hndVConn);

  // trace state
  bTrace = bsClientAttrGetTraceState(pClient, hndVConn);

  //
  // Set request message values.
  //
  msgReq.m_speedleft  = (short)nSpeedLeft;
  msgReq.m_speedright = (short)nSpeedRight;

  //
  // Pack request.
  //
  n = BsKuonPackReqSetMotorSpeeds(&msgReq, BSPROXY_BUF_BODY(buf), bTrace);

  // check packing return code
  BSCLIENT_TRY_NM_ECODE(pClient, n, "MsgId=%u", msgIdReq);

  //
  // Execute request-response transaction.
  //
  n = bsClientTrans(pClient,  hndVConn,
                    msgIdReq, buf, (size_t)n,
                    msgIdRsp, buf, sizeof(buf));

  // check transaction return code
  BSCLIENT_TRY_ECODE(pClient, n, "MsgId=%u: Transaction failed.", msgIdReq);

  //
  // Set return values from response.
  //
  LOGDIAG3("%s: SetSpeeds: (%d,%d).", bsClientAttrGetName(pClient),
                                nSpeedLeft, nSpeedRight);

  return BS_OK;
}
/*!
 * \brief Proxied request to set robot's motor speeds.
 *
 * \param pClient     \h_botsense client.
 * \param hndVConn    Handle to virtual connection to close.
 * \param nSpeedLeft  Left motor speed in current units.
 * \param nSpeedRight Right motor speed in current units.
 *
 * \copydoc doc_return_bs_std
 */
\brief Proxied request to set robot's motor speeds.
\param pClient     \h_botsense client.
\param hndVConn    Handle to virtual connection to close.
\param nSpeedLeft  Left motor speed in current units.
\param nSpeedRight Right motor speed in current units.


\ brief Proxied request to set robot ' s motor speeds . \ param pClient \ h_botsense client . \ param hndVConn Handle to virtual connection to close . \ param nSpeedLeft Left motor speed in current units . \ param nSpeedRight Right motor speed in current units .
int bsKuonReqSetMotorSpeeds(BsClient_P   pClient,
                          BsVConnHnd_T hndVConn,
                          int          nSpeedLeft,
                          int          nSpeedRight)
{
  static BsKuonMsgId_T    msgIdReq = BsKuonMsgIdReqSetMotorSpeeds;
  static BsProxyMsgId_T   msgIdRsp = BsProxyMsgIdRspOk;
  BsKuonReqSetMotorSpeeds_T msgReq;                   
  byte_t                  buf[BSPROXY_MSG_MAX_LEN]; 
  bool_t                  bTrace;                   
  int                     n;                        
   Parameter checks.
  BSCLIENT_TRY_EXPR(pClient, BSCLIENT_HAS_VCONN(pClient, hndVConn),
      BS_ECODE_BAD_VAL, "VConn=%d", hndVConn);
   trace state
  bTrace = bsClientAttrGetTraceState(pClient, hndVConn);
   Set request message values.
  msgReq.m_speedleft  = (short)nSpeedLeft;
  msgReq.m_speedright = (short)nSpeedRight;
   Pack request.
  n = BsKuonPackReqSetMotorSpeeds(&msgReq, BSPROXY_BUF_BODY(buf), bTrace);
   check packing return code
  BSCLIENT_TRY_NM_ECODE(pClient, n, "MsgId=%u", msgIdReq);
   Execute request-response transaction.
  n = bsClientTrans(pClient,  hndVConn,
                    msgIdReq, buf, (size_t)n,
                    msgIdRsp, buf, sizeof(buf));
   check transaction return code
  BSCLIENT_TRY_ECODE(pClient, n, "MsgId=%u: Transaction failed.", msgIdReq);
   Set return values from response.
  LOGDIAG3("%s: SetSpeeds: (%d,%d).", bsClientAttrGetName(pClient),
                                nSpeedLeft, nSpeedRight);
  return BS_OK;
}
int bsKuonReqSetMotorSpeeds ( BsClient_P pClient , BsVConnHnd_T hndVConn , int nSpeedLeft , int nSpeedRight ) { static BsKuonMsgId_T msgIdReq = BsKuonMsgIdReqSetMotorSpeeds ; static BsProxyMsgId_T msgIdRsp = BsProxyMsgIdRspOk ; BsKuonReqSetMotorSpeeds_T msgReq ; byte_t buf [ BSPROXY_MSG_MAX_LEN ] ; bool_t bTrace ; int n ; BSCLIENT_TRY_EXPR ( pClient , BSCLIENT_HAS_VCONN ( pClient , hndVConn ) , BS_ECODE_BAD_VAL , " " , hndVConn ) ; bTrace = bsClientAttrGetTraceState ( pClient , hndVConn ) ; msgReq . m_speedleft = ( short ) nSpeedLeft ; msgReq . m_speedright = ( short ) nSpeedRight ; n = BsKuonPackReqSetMotorSpeeds ( & msgReq , BSPROXY_BUF_BODY ( buf ) , bTrace ) ; BSCLIENT_TRY_NM_ECODE ( pClient , n , " " , msgIdReq ) ; n = bsClientTrans ( pClient , hndVConn , msgIdReq , buf , ( size_t ) n , msgIdRsp , buf , sizeof ( buf ) ) ; BSCLIENT_TRY_ECODE ( pClient , n , " " , msgIdReq ) ; LOGDIAG3 ( " " , bsClientAttrGetName ( pClient ) , nSpeedLeft , nSpeedRight ) ; return BS_OK ; }
\brief Proxied request to set robot's motor speeds.
\ brief Proxied request to set robot ' s motor speeds .
// request message  // req/rsp buffer // do [not] trace messages // num of bytes/return code // // Parameter checks. // // trace state // // Set request message values. // // // Pack request. // // check packing return code // // Execute request-response transaction. // // check transaction return code // // Set return values from response. //