MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / CreateBusChannel

Method CreateBusChannel

lib/mdflib/mdflib/src/iconfigadapter.cpp:354–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354IChannel* 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
382IChannel* IConfigAdapter::CreateSubChannel(IChannel& parent_channel,
383 const std::string_view& sub_name,

Callers

nothing calls this directly

Calls 13

MessageFilterEnum · 0.85
NameMethod · 0.45
TypeMethod · 0.45
SyncMethod · 0.45
DataTypeMethod · 0.45
FlagsMethod · 0.45
RangeMethod · 0.45
ParameterMethod · 0.45
ByteOffsetMethod · 0.45
BitOffsetMethod · 0.45

Tested by

no test coverage detected