Skip to main content
added 563 characters in body
Source Link
Kristof Claes
  • 568
  • 1
  • 5
  • 10

How about using Generate as prefix?

GenerateMonitorPacket
GenerateControlTempPacket
GeneratePutPeakInfoPacket
GenerateGetPeakInfoPacket

Alternatively, you can also create a separate class for each type of packet generator. You've only shown the code to create the packet for Monitor, so I don't know how complex the code for the other packets is, but separating these four methods into their own class might be logical and beneficial in the long run. If you create separate classes, you put the name of the packet (Monitor, ControlTemp, PutPeakInfo and GetPeakInfo) in the class name.

public class MonitorPacketGenerator
{
    public byte[] Generate(int ddcNum) { ... }
}

How about using Generate as prefix?

GenerateMonitorPacket
GenerateControlTempPacket
GeneratePutPeakInfoPacket
GenerateGetPeakInfoPacket

How about using Generate as prefix?

GenerateMonitorPacket
GenerateControlTempPacket
GeneratePutPeakInfoPacket
GenerateGetPeakInfoPacket

Alternatively, you can also create a separate class for each type of packet generator. You've only shown the code to create the packet for Monitor, so I don't know how complex the code for the other packets is, but separating these four methods into their own class might be logical and beneficial in the long run. If you create separate classes, you put the name of the packet (Monitor, ControlTemp, PutPeakInfo and GetPeakInfo) in the class name.

public class MonitorPacketGenerator
{
    public byte[] Generate(int ddcNum) { ... }
}
Source Link
Kristof Claes
  • 568
  • 1
  • 5
  • 10

How about using Generate as prefix?

GenerateMonitorPacket
GenerateControlTempPacket
GeneratePutPeakInfoPacket
GenerateGetPeakInfoPacket