Einzelnen Beitrag anzeigen

Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.755 Beiträge
 
Delphi 10.4 Sydney
 
#8

Re: Funktion Parameter zuweisen (Array of Byte)

  Alt 15. Sep 2006, 07:51
@Mavarik

nun, ich habe eine Datensatz der besteht aus 176 Byte
Diese lese ich ein ein Array ein:
Die Datensatzstruktur ist die folgende:

Delphi-Quellcode:
  
TKDUSet = record
    case boolean of
      true: (rawSet: Array [1..176] of Byte);
      false: ( //Gap: Array [1..60] of Byte;
               //FileManagementData: Array[1..12] of Char;
               FaultType: Byte;
               Direction: Byte;
               MessageNumber: Array [0..1] of Byte;
               TargetNode: Array [0..15] of Byte;
               Cause : Array [0..7] of Byte;
               Time : Array [0..7] of Byte;
               S_RNTI: Array [0..3] of Byte;
               RNCType: Byte;
               UEState: Byte;
               MainProcedure: Byte;
               Reserved : Byte;
               DRNCProcedure: Byte;
               DRNCState: Byte;
               MUEProcedure: Byte;
               MUEState : Byte;
               CRLProcedure: Byte;
               CRLState: Byte;
               TBProcedure: Byte;
               TBState: Byte;
               RACInstanceGroupID: Byte;
               RACInstanceProcessID: Byte;
               RACInstanceUEInstance: Array [0..1] of Byte;
               RRCEstablishmentCause: Byte;
               UEIDType: Byte;
               UEID: Array [0..7] of Byte;
               UEReleaseIndicator: Byte;
               HSDPAState: Byte;
               ServiceType: Array [0..1] of Byte;
               ULTFCSType: Byte;
               DLTFCSType: Byte;
               RLInformation: Array [0..3] of Array [0..7] of Byte;
               HWInformationDCCH: Array [0..23] of Byte;
               HWInformationServiceType: Array [0..1] of Array [0..23] of Byte;
              )
  end;
Wie man hier sieht ist RLInformation ein Array [0..7] of Byte.
RLInformation ist wieder ein eigener Datensatz:

Delphi-Quellcode:
  RLInformation = record
     case boolean of
       true : (rawSet :Array [0..7] of Byte);
       false: ( RNCID: Array [0..1] of Byte;
                CellID: Array [0..1] of Byte;
                BTSNumber: Array [0..1] of Byte;
                CPICHEc_N0: Byte;
                HSDPAIndicator: Byte;
              )
  end;
Ich arbeite hier mit Records weil ich dann einfacher auf die einzelnen Datenfelder zugreifen kann
ohne immer in dem Array hin und her zu springen.
Hierzu bieten sich, meiner Meinung nach, variante Records an.
Denn man kann hier relative einfach das Mapping von Datensatz auf Datenfelder vornehmen.

Ich bin damit auch relative unabhängig wenn sich die Datenstruktur innerhalb z.B.
RLInformation ändert. Ich brauche dann, entsprechend nur die Recordstruktur ändern.

Grüße
Klaus
Klaus
  Mit Zitat antworten Zitat