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

Method CreateFrameChannels

lib/mdflib/mdflib/src/ethconfigadapter.cpp:169–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169void EthConfigAdapter::CreateFrameChannels(IChannelGroup& group) const {
170 const bool mandatory = writer_.MandatoryMembersOnly();
171 auto* cn_frame = group.CreateChannel("ETH_Frame");
172 if (cn_frame == nullptr) {
173 MDF_ERROR() << "Failed to create the channel. Name :" << "ETH_Frame";
174 return;
175 }
176
177 cn_frame->Type(ChannelType::FixedLength);
178 cn_frame->Sync(ChannelSyncType::None);
179 cn_frame->DataBytes(mandatory ? 35 - 8 : 42 - 8);
180 cn_frame->Flags(CnFlag::BusEvent);
181 cn_frame->DataType(ChannelDataType::ByteArray);
182
183 CreateBusChannel(*cn_frame);
184 CreateSource(*cn_frame);
185 CreateDestination(*cn_frame);
186 CreateBitsChannel(*cn_frame, "ETH_Frame.EtherType", 21, 0 , 16);
187 if (IChannel* nof_rec = CreateBitsChannel(*cn_frame, "ETH_Frame.ReceivedDataByteCount", 23, 0 , 16);
188 nof_rec != nullptr) {
189 nof_rec->Unit("B");
190 }
191 if (IChannel* frame_length = CreateBitsChannel(*cn_frame, "ETH_Frame.DataLength",25, 0 , 16 );
192 frame_length != nullptr) {
193 frame_length->Unit("B");
194 }
195
196 if (mandatory) {
197 // In reality the VSLD-CG storage is the only possible solution. The
198 // SD storage is possible in theory only.
199 CreateDataBytes(*cn_frame, 27);
200 return;
201 }
202 CreateBitsChannel(*cn_frame, "ETH_Frame.CRC", 27, 0 , 32);
203 CreateBitChannel(*cn_frame, "ETH_Frame.Dir",31 , 0);
204
205 if (IChannel* padding_bytes = CreateBitsChannel(*cn_frame, "ETH_Frame.PadByteCount", 32, 0 , 16);
206 padding_bytes != nullptr) {
207 padding_bytes->Unit("B");
208 }
209 CreateDataBytes(*cn_frame, 34);
210}
211
212void EthConfigAdapter::CreateChecksumErrorChannels(IChannelGroup& group) const {
213 const bool mandatory = writer_.MandatoryMembersOnly();

Callers

nothing calls this directly

Calls 12

CreateSourceFunction · 0.85
CreateDestinationFunction · 0.85
CreateDataBytesFunction · 0.85
CreateBitChannelFunction · 0.85
MandatoryMembersOnlyMethod · 0.45
CreateChannelMethod · 0.45
TypeMethod · 0.45
SyncMethod · 0.45
DataBytesMethod · 0.45
FlagsMethod · 0.45
DataTypeMethod · 0.45
UnitMethod · 0.45

Tested by

no test coverage detected