| 352 | } |
| 353 | |
| 354 | IChannel* IConfigAdapter::CreateBusChannel( IChannel& parent_channel) const { |
| 355 | std::ostringstream name; |
| 356 | name << parent_channel.Name() << ".BusChannel"; |
| 357 | const bool fixed_channel = ChannelFilter() > 0 |
| 358 | && MessageFilter() != MessageFilter::NoFilter; |
| 359 | IChannel* frame_bus = parent_channel.CreateChannelComposition(name.str()); |
| 360 | if (frame_bus != nullptr) { |
| 361 | frame_bus->Type(ChannelType::FixedLength); |
| 362 | frame_bus->Sync(ChannelSyncType::None); |
| 363 | frame_bus->DataType(ChannelDataType::UnsignedIntegerLe); |
| 364 | frame_bus->Flags(CnFlag::BusEvent | CnFlag::RangeValid); |
| 365 | frame_bus->Range(0, 255); |
| 366 | if (fixed_channel) { |
| 367 | if (IChannelConversion* fixed_conv = frame_bus->CreateChannelConversion(); |
| 368 | fixed_conv != nullptr) { |
| 369 | fixed_conv->Name("Fixed Bus Channel"); |
| 370 | fixed_conv->Type(ConversionType::Linear); |
| 371 | fixed_conv->Parameter(0, ChannelFilter()); |
| 372 | fixed_conv->Parameter(1, 0.0 ); |
| 373 | } |
| 374 | } |
| 375 | frame_bus->ByteOffset(8+0); // Always after the time |
| 376 | frame_bus->BitOffset(0); |
| 377 | frame_bus->BitCount(8); |
| 378 | } |
| 379 | return frame_bus; |
| 380 | } |
| 381 | |
| 382 | IChannel* IConfigAdapter::CreateSubChannel(IChannel& parent_channel, |
| 383 | const std::string_view& sub_name, |
nothing calls this directly
no test coverage detected