Refactor (NGAP): adopt TO_ENUM/TO_TEXT pattern for NGAP enums
TO_ENUM/TO_TEXT are already used in NAS, and can be adopted in NGAP. To avoid duplication, the following changes are introduced: * Move text_info_t, TO_ENUM, TO_TEXT to common/utils/utils.h * Include utils.h include to ngap_messages_types.h, fgs_nas_utils.h, and fgmm_lib.h * RRC establishment cause: refactor to FOREACH_RRC_ESTABLISHMENT_CAUSE macro * Cause Group: refactor to FOREACH_CAUSE_GROUP macro * Radio Network Cause: refactor to FOREACH_CAUSE_RADIO_NETWORK macro * Protocol Cause: refactor to FOREACH_CAUSE_PROTOCOL macro This change is preparatory to the introduction the paging lib with unit tests, with the goal of reducing the inter-dependency between concurrent NGAP libs.
This commit is contained in:
@@ -109,6 +109,15 @@ int hex_char_to_hex_value (char c);
|
||||
// Converts an hexadecimal ASCII coded string into its value.**
|
||||
int hex_string_to_hex_value (uint8_t *hex_value, const char *hex_string, int size);
|
||||
|
||||
/* Map task id to printable name. */
|
||||
typedef struct {
|
||||
int id;
|
||||
char text[256];
|
||||
} text_info_t;
|
||||
|
||||
#define TO_TEXT(LabEl, nUmID) {nUmID, #LabEl},
|
||||
#define TO_ENUM(LabEl, nUmID) LabEl = nUmID,
|
||||
|
||||
char *itoa(int i);
|
||||
|
||||
#define STRINGIFY(S) #S
|
||||
|
||||
Reference in New Issue
Block a user