How to use the construct.String function in construct

To help you get started, we’ve selected a few construct examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PIC-IRIS / PH5 / ph5 / core / rt_130_h.py View on Github external
def time_trigger():
    TIM = construct.Struct("TIM",
                           construct.String("StartTime", 14),
                           construct.String("RepeatInterval", 8),
                           construct.String("Intervals", 4),
                           construct.String("Reserved1", 8),
                           construct.String("RecordLength", 8),
                           construct.String("Reserved2", 120))
    return TIM
github PIC-IRIS / PH5 / ph5 / core / rt_130_h.py View on Github external
construct.BitStruct("BIN",
                                              construct.BitField(
                                                  "PacketHeader", 128)),
                          construct.Struct("_72ACalibration",
                                           construct.String("StartTime", 14),
                                           construct.String(
                                               "RepeatInterval", 8),
                                           construct.String("Intervals", 4),
                                           construct.String("Length", 8),
                                           construct.String("StepOnOff", 4),
                                           construct.String("StepPeriod", 8),
                                           construct.String("StepSize", 8),
                                           construct.String(
                                               "StepAmplitude", 8),
                                           construct.String("StepOutput", 4),
                                           construct.String("Reserved", 48)),
                          construct.Struct("_130AutoCenter1",
                                           construct.String("Sensor", 1),
                                           construct.String("Enable", 1),
                                           construct.String(
                                               "ReadingInterval", 4),
                                           construct.String(
                                               "CycleInterval", 2),
                                           construct.String("Level", 4),
                                           construct.String("Attempts", 2),
                                           construct.String("AttemptInterval",
                                                            2)),
                          construct.Struct("_130AutoCenter2",
                                           construct.String("Sensor", 1),
                                           construct.String("Enable", 1),
                                           construct.String(
                                               "ReadingInterval", 4),
github PIC-IRIS / PH5 / ph5 / core / rt_130_h.py View on Github external
"DataStream", 8),
                                              construct.BitField(
                                                  "Reserved", 24),
                                              construct.BitField("Flags", 8),
                                              construct.BitField("DataFormat",
                                                                 8)),
                          construct.String("TriggerTimeMessage", 33),
                          construct.String("TimeSource", 1),
                          construct.String("TimeQuality", 1),
                          construct.String("ExtStationName", 1),
                          construct.String("StationName", 4),
                          construct.String("StreamName", 16),
                          construct.String("Reserved1", 8),
                          construct.String("SampleRate", 4),
                          construct.String("TriggerType", 4),
                          construct.String("TriggerTime", 16),
                          construct.String("FirstSampleTime", 16),
                          construct.String("DetriggerTime", 16),
                          construct.String("LastSampleTime", 16),
                          construct.String("NominalBitWeight", 128),
                          construct.String("TrueBitWeight", 128),
                          construct.String("Gain", 16),
                          construct.String("A_DResolution", 16),
                          construct.String("FullScaleAnalog", 16),
                          construct.String("ChannelCode", 64),
                          construct.String("SensorFSA", 16),
                          construct.String("SensorVPU", 96),
                          construct.String("SensorUnits", 16),
                          construct.String("StationNumber", 48),
                          construct.String("Reserved2", 156),
                          construct.String("TotalChannels", 2),
                          construct.String("Comment", 40),
github PIC-IRIS / PH5 / ph5 / core / rt_130_h.py View on Github external
construct.String("ExtStationName", 1),
                          construct.String("StationName", 4),
                          construct.String("StreamName", 16),
                          construct.String("Reserved1", 8),
                          construct.String("SampleRate", 4),
                          construct.String("TriggerType", 4),
                          construct.String("TriggerTime", 16),
                          construct.String("FirstSampleTime", 16),
                          construct.String("DetriggerTime", 16),
                          construct.String("LastSampleTime", 16),
                          construct.String("NominalBitWeight", 128),
                          construct.String("TrueBitWeight", 128),
                          construct.String("Gain", 16),
                          construct.String("A_DResolution", 16),
                          construct.String("FullScaleAnalog", 16),
                          construct.String("ChannelCode", 64),
                          construct.String("SensorFSA", 16),
                          construct.String("SensorVPU", 96),
                          construct.String("SensorUnits", 16),
                          construct.String("StationNumber", 48),
                          construct.String("Reserved2", 156),
                          construct.String("TotalChannels", 2),
                          construct.String("Comment", 40),
                          construct.String("FilterList", 16),
                          construct.String("Position", 26),
                          construct.String("RefTek120", 80))
    return EH
github PIC-IRIS / PH5 / ph5 / core / segd_h.py View on Github external
def storage_unit_label():
    BIN = construct.Struct("BIN",
                           construct.String("storage_unit_sequence_number", 4),
                           construct.String("fairfield_revision", 5),
                           construct.String("storage_unit_structure", 6),
                           construct.String("binding_edition", 4),
                           construct.String("max_block_size", 10),
                           construct.String("api_producer_code", 10),
                           construct.String("creation_date", 11),
                           construct.String("serial_number", 12),
                           construct.String("reserved01", 6),
                           construct.String("external_label_name", 12),
                           construct.String("recording_entity_name", 24),
                           construct.String("user_defined", 14),
                           construct.String("max_file_size_MB", 10))
    return BIN
github PIC-IRIS / PH5 / ph5 / core / rt_130_h.py View on Github external
def event_trigger():
    EVT = construct.Struct("EVT",
                           construct.String("TriggerChannels", 16),
                           construct.String("MinimumChannels", 2),
                           construct.String("TriggerWindow", 8),
                           construct.String("PretriggerLength", 8),
                           construct.String("PosttriggerLength", 8),
                           construct.String("RecordLength", 8),
                           construct.String("Reserved1", 8),
                           construct.String("STALength", 8),
                           construct.String("LTALength", 8),
                           construct.String("MeanRemoval", 8),
                           construct.String("TriggerRatio", 8),
                           construct.String("DetriggerRatio", 8),
                           construct.String("LTAHold", 4),
                           construct.String("LowPassCornerFreq", 4),
                           construct.String("HighPassCornerFreq", 4),
                           construct.String("Reserved2", 52))
    return EVT
github PIC-IRIS / PH5 / ph5 / core / rt_130_h.py View on Github external
construct.String("ChannelName", 10),
                                           construct.String("Azimuth", 10),
                                           construct.String("Inclination", 10),
                                           construct.String("XCoordinate", 10),
                                           construct.String("YCoordinate", 10),
                                           construct.String("ZCoordinate", 10),
                                           construct.String("XYUnits", 4),
                                           construct.String("ZUnits", 4),
                                           construct.String("PreampGain", 4),
                                           construct.String("SensorModel", 12),
                                           construct.String(
                                               "SensorSerial", 12),
                                           construct.String("Comments", 40),
                                           construct.String(
                                               "AdjustedNominalBitWeight", 8)),
                          construct.String("Reserved", 76),
                          construct.String("ImplementTime", 16))
    return SC
github PIC-IRIS / PH5 / ph5 / core / rt_130_h.py View on Github external
construct.String("TriggerTimeMessage", 33),
                          construct.String("TimeSource", 1),
                          construct.String("TimeQuality", 1),
                          construct.String("ExtStationName", 1),
                          construct.String("StationName", 4),
                          construct.String("StreamName", 16),
                          construct.String("Reserved1", 8),
                          construct.String("SampleRate", 4),
                          construct.String("TriggerType", 4),
                          construct.String("TriggerTime", 16),
                          construct.String("FirstSampleTime", 16),
                          construct.String("DetriggerTime", 16),
                          construct.String("LastSampleTime", 16),
                          construct.String("NominalBitWeight", 128),
                          construct.String("TrueBitWeight", 128),
                          construct.String("Gain", 16),
                          construct.String("A_DResolution", 16),
                          construct.String("FullScaleAnalog", 16),
                          construct.String("ChannelCode", 64),
                          construct.String("SensorFSA", 16),
                          construct.String("SensorVPU", 96),
                          construct.String("SensorUnits", 16),
                          construct.String("StationNumber", 48),
                          construct.String("Reserved2", 156),
                          construct.String("TotalChannels", 2),
                          construct.String("Comment", 40),
                          construct.String("FilterList", 16),
                          construct.String("Position", 26),
                          construct.String("RefTek120", 80))
    return EH
github PIC-IRIS / PH5 / ph5 / core / rt_130_h.py View on Github external
construct.BitField("Flags", 8),
                                              construct.BitField("DataFormat",
                                                                 8)),
                          construct.String("TriggerTimeMessage", 33),
                          construct.String("TimeSource", 1),
                          construct.String("TimeQuality", 1),
                          construct.String("ExtStationName", 1),
                          construct.String("StationName", 4),
                          construct.String("StreamName", 16),
                          construct.String("Reserved1", 8),
                          construct.String("SampleRate", 4),
                          construct.String("TriggerType", 4),
                          construct.String("TriggerTime", 16),
                          construct.String("FirstSampleTime", 16),
                          construct.String("DetriggerTime", 16),
                          construct.String("LastSampleTime", 16),
                          construct.String("NominalBitWeight", 128),
                          construct.String("TrueBitWeight", 128),
                          construct.String("Gain", 16),
                          construct.String("A_DResolution", 16),
                          construct.String("FullScaleAnalog", 16),
                          construct.String("ChannelCode", 64),
                          construct.String("SensorFSA", 16),
                          construct.String("SensorVPU", 96),
                          construct.String("SensorUnits", 16),
                          construct.String("StationNumber", 48),
                          construct.String("Reserved2", 156),
                          construct.String("TotalChannels", 2),
                          construct.String("Comment", 40),
                          construct.String("FilterList", 16),
                          construct.String("Position", 26),
                          construct.String("RefTek120", 80))
github PIC-IRIS / PH5 / ph5 / core / rt_130_h.py View on Github external
construct.String("Attempts", 2),
                                           construct.String("AttemptInterval",
                                                            2)),
                          construct.Struct("_130AutoCenter4",
                                           construct.String("Sensor", 1),
                                           construct.String("Enable", 1),
                                           construct.String(
                                               "ReadingInterval", 4),
                                           construct.String(
                                               "CycleInterval", 2),
                                           construct.String("Level", 4),
                                           construct.String("Attempts", 2),
                                           construct.String("AttemptInterval",
                                                            2)),
                          construct.Struct("_130Calibration1",
                                           construct.String("Sensor", 1),
                                           construct.String("Enable", 1),
                                           construct.String("Reserved", 2),
                                           construct.String("Duration", 4),
                                           construct.String("Amplitude", 4),
                                           construct.String("Signal", 4),
                                           construct.String("StepInterval", 4),
                                           construct.String("StepWidth", 4),
                                           construct.String("SineFrequency",
                                                            4)),
                          construct.Struct("_130Calibration2",
                                           construct.String("Sensor", 1),
                                           construct.String("Enable", 1),
                                           construct.String("Reserved", 2),
                                           construct.String("Duration", 4),
                                           construct.String("Amplitude", 4),
                                           construct.String("Signal", 4),