MCPcopy Create free account
hub / github.com/EIPStackGroup/OpENer / AllocateAttributeMasks

Function AllocateAttributeMasks

source/src/cip/cipcommon.c:896–904  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

894}
895
896void AllocateAttributeMasks(CipClass *target_class) {
897 size_t size = 1 + CalculateIndex(target_class->highest_attribute_number);
898 OPENER_TRACE_INFO(
899 ">>> Allocate memory for %s %lu bytes times 3 for masks\n",
900 target_class->class_name, size);
901 target_class->get_single_bit_mask = CipCalloc(size, sizeof(uint8_t) );
902 target_class->set_bit_mask = CipCalloc(size, sizeof(uint8_t) );
903 target_class->get_all_bit_mask = CipCalloc(size, sizeof(uint8_t) );
904}
905
906size_t CalculateIndex(EipUint16 attribute_number) {
907 size_t index = attribute_number / 8;

Callers 1

CreateCipClassFunction · 0.85

Calls 2

CalculateIndexFunction · 0.85
CipCallocFunction · 0.50

Tested by

no test coverage detected