FACT++  1.0
void ConnectionDrive::SendSdoRequest ( uint8_t  node,
uint8_t  req,
uint16_t  idx,
uint8_t  subidx,
uint32_t  val = 0 
)
inlineprivate

Definition at line 1239 of file drivectrl.cc.

References HandleTimeout().

1241  {
1242  if (fVerbosity>1)
1243  Out() << "SDO-" << (req==kTxSdo?"REQ":"SET") << "[" << int(node) << "] " << idx << "/" << int(subidx) << " = " << val << endl;
1244 
1245 
1246  SendCanFrame(0x600|(node&0x1f), req, idx&0xff, idx>>8, subidx,
1247  val&0xff, (val>>8)&0xff, (val>>16)&0xff, (val>>24)&0xff);
1248 
1249  // - The boost::asio::basic_deadline_timer::expires_from_now()
1250  // function cancels any pending asynchronous waits, and returns
1251  // the number of asynchronous waits that were cancelled. If it
1252  // returns 0 then you were too late and the wait handler has
1253  // already been executed, or will soon be executed. If it
1254  // returns 1 then the wait handler was successfully cancelled.
1255  // - If a wait handler is cancelled, the bs::error_code passed to
1256  // it contains the value bs::error::operation_aborted.
1257 
1258  const uint32_t milliseconds = 3000;
1259  fTimeouts.emplace_front(get_io_service(), node, req, idx, subidx, val, milliseconds);
1260 
1261  const std::list<Timeout_t>::iterator &timeout = fTimeouts.begin();
1262 
1263  timeout->async_wait(boost::bind(&ConnectionDrive::HandleTimeout, this, timeout, ba::placeholders::error));
1264  }
Definition: dns.c:26
std::list< Timeout_t > fTimeouts
Definition: drivectrl.cc:1016
std::ostream & Out()
Definition: Connection.h:51
void HandleTimeout(const std::list< Timeout_t >::iterator &ref, const bs::error_code &error)
Definition: drivectrl.cc:1233
uint16_t fVerbosity
Definition: drivectrl.cc:484
void SendCanFrame(uint16_t cobid, uint8_t m0=0, uint8_t m1=0, uint8_t m2=0, uint8_t m3=0, uint8_t m4=0, uint8_t m5=0, uint8_t m6=0, uint8_t m7=0)
Definition: drivectrl.cc:537

+ Here is the call graph for this function: