コード例 #1
0
  bool ProprietaryMessageA_c::sendWithPrio( unsigned prio, const IsoName_c& a_overwrite_remote ) {

    isoaglib_assert( prio <= 7 );
    isoaglib_assert(m_ident);
    // do not allow overwrite to a different target if m_remote is specified
    isoaglib_assert(!m_remote.isSpecified() || a_overwrite_remote.isUnspecified() || (a_overwrite_remote == m_remote));

    const uint32_t pgn = ( uint32_t( m_dp ) << 16) | PROPRIETARY_A_PGN;
    if (getDataSend().getLen() <= 8)
    {
      CanPkgExt_c pkg;

      pkg.setIsoPri( static_cast<uint8_t>( prio ) );
      pkg.setIsoPgn( pgn );
      pkg.setISONameForDA( a_overwrite_remote.isSpecified() ? a_overwrite_remote : m_remote );
      pkg.setMonitorItemForSA( m_ident->getIsoItem() );
      pkg.setDataFromString ( getDataSend().getDataStream(), static_cast<uint8_t>( getDataSend().getLen() ) );
      getIsoBusInstance( m_ident->getMultitonInst() ) << pkg;
      return true;
    }
    else
    { /** multi-packet */
      /** variable should be evaluated */
      // const bool cb_couldStartMultiSend =
      // we could catch the information if the sending succeeded, but what to do with it anyway?
      return getMultiSendInstance( m_ident->getMultitonInst() ).sendIsoTarget(
         m_ident->isoName(),
         a_overwrite_remote.isSpecified() ? a_overwrite_remote : m_remote,
         getDataSend().getDataStream(0),
         getDataSend().getLen(),
         pgn,
         this );
    }
  }
コード例 #2
0
  bool ProprietaryMessageB_c::send( uint8_t ps ) {

    isoaglib_assert(m_ident);

    const uint32_t pgn = ( uint32_t( m_dp ) << 16) | PROPRIETARY_B_PGN | ps;
    if (getDataSend().getLen() <= 8)
    {
      CanPkgExt_c pkg;

      pkg.setIsoPri( 6 );
      pkg.setIsoPgn( pgn );
      pkg.setMonitorItemForSA( m_ident->getIsoItem() );
      pkg.setDataFromString ( getDataSend().getDataStream(), static_cast<uint8_t>( getDataSend().getLen() ) );
      getIsoBusInstance( m_ident->getMultitonInst() ) << pkg;
      return true;
    }
    else
    { /** multi-packet */
      /** variable should be evaluated */
      // const bool cb_couldStartMultiSend =
      // we could catch the information if the sending succeeded, but what to do with it anyway?
      return getMultiSendInstance( m_ident->getMultitonInst() ).sendIsoTarget(
         m_ident->isoName(),
         m_remote,
         getDataSend().getDataStream(0),
         getDataSend().getLen(),
         pgn,
         this );
    }
  }