I created two classes "DEVICE_s" and "DEVICE_SET_s" as following:
Device_Manager.h
typedef struct DEVICE_s DEVICE_s;
typedef struct DEVICE_SET_s DEVICE_SET_s;
Device_Manager.c
struct DEVICE_s
{
uint32_t IP;
TYPE_e Type;
METHOD_e Method;
GROUP_RULE_e GroupRule;
char Name[NAME_SIZE];
};
struct DEVICE_SET_s
{
uint8_t Total;
uint8_t Used;
uint8_t Available;
DEVICE_s Set[SET_SIZE];
};
DEVICE_s Instance;
DEVICE_SET_s Objects;
Because I put these two classes within a same file, all functions that manipulate variables "Instance" and "Objects" are put together inside this file.
I think this way is bad considering to modularity, so I want to create another source file to separately manage class "DEVICE_SET_s", just like:
DeviceSet_Manager.h
typedef struct DEVICE_SET_s DEVICE_SET_s;
DeviceSet_Manager.c
#include "Device_Manager.h"
#include "DeviceSet_Manager.h"
struct DEVICE_SET_s
{
uint8_t Total;
uint8_t Used;
uint8_t Available;
DEVICE_s Set[SET_SIZE]; //Oops! Incomplete Type Is Not Allowed
};
However, In terms of DeviceSet_Manager.c, class "DEVICE_s" is not visible(not a complete type).
How do I fix this? Thanks