Skip to content

Commit

Permalink
Update cdap to use new function naming
Browse files Browse the repository at this point in the history
  • Loading branch information
masonticehurst committed Feb 14, 2024
1 parent 7769149 commit 9bd8c5c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions eRINA_STM32F7/src/net/cdap.adb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ package body CDAP is
end loop;

-- Decode and update message
ObjValue.Set_Field (Field_Id, To_VARINT (VARINT_Vector));
ObjValue.Set_Field (Field_Id, VARINT_To_Uint64 (VARINT_Vector));
end;
end if;

Expand All @@ -201,7 +201,7 @@ package body CDAP is
end loop;

-- The VARINT storing the length is an int32
LEN_Length := Natural (To_VARINT (LEN_Vector));
LEN_Length := Natural (VARINT_To_Uint64 (LEN_Vector));

while C /= Byte_Vectors.No_Element loop
Data_Vector.Append (V (C));
Expand All @@ -222,14 +222,14 @@ package body CDAP is
end To_OBJ_Value;

function Tag_To_OBJ_Value_Field (Input : Byte_Vector) return Obj_Value_Field is
Value : constant Uint64 := To_VARINT(Input) / 2 ** 3;
Value : constant Uint64 := VARINT_To_Uint64(Input) / 2 ** 3;
begin
-- MT: TODO: Need to handle weird case when resulting value does not match an enum in Obj_Value
return Obj_Value_Field'Enum_Val (Value);
end Tag_To_OBJ_Value_Field;

function Tag_To_CDAP_Field (Input : Byte_Vector) return CDAP_Field is
Value : constant Uint64 := To_VARINT(Input) / 2 ** 3;
Value : constant Uint64 := VARINT_To_Uint64(Input) / 2 ** 3;
begin
-- MT: TODO: Need to handle weird case when resulting value does not match an enum in CDAP_Field
return CDAP_Field'Enum_Val (Value);
Expand Down Expand Up @@ -408,7 +408,7 @@ package body CDAP is
end loop;

-- Decode and update message
Result_Msg.Set_Field (Field_Id, To_VARINT (VARINT_Vector));
Result_Msg.Set_Field (Field_Id, VARINT_To_Uint64 (VARINT_Vector));
end;
end if;

Expand All @@ -429,7 +429,7 @@ package body CDAP is
end loop;

-- The VARINT storing the length is an int32
LEN_Length := Natural (To_VARINT (LEN_Vector));
LEN_Length := Natural (VARINT_To_Uint64 (LEN_Vector));

while C /= Byte_Vectors.No_Element loop
Data_Vector.Append (V (C));
Expand Down

0 comments on commit 9bd8c5c

Please sign in to comment.