In the template project one gets an error using the Keil compiler in gap.h here
///Random Address type
enum gap_rnd_addr_type
{
///Static random address
GAP_STATIC_ADDR = SMPM_ADDR_TYPE_STATIC,
///Private non resolvable address
GAP_NON_RSLV_ADDR = SMPM_ADDR_TYPE_PRIV_NON_RESOLV,
///Private resolvable address
GAP_RSLV_ADDR = SMPM_ADDR_TYPE_PRIV_RESOLV,
};
THis is a case where an enum is being delcared by another enum defined in smpm.h which is
/**
* Random Address Types
*/
enum smpm_rand_addr_type
{
///Private Non Resolvable - 00 (MSB->LSB)
SMPM_ADDR_TYPE_PRIV_NON_RESOLV = 0 x00,
///Private Resolvable - 01
SMPM_ADDR_TYPE_PRIV_RESOLV = 0x40,
///Static - 11
SMPM_ADDR_TYPE_STATIC = 0xC0,
};
There error reported by the compiler is that the values in gap.h for the gap_rnd_addr_type enum are undefined. THis nested use of enums appears weird. Why is this happening and what can I do to resolve it. (Note this is not code I have written but was done by DS and/or RW. Thanks for a resolution.
Oh yes, the smpm.h header is included in the gap.h header.
Not sure I understand the issue. Are you saying that you are unable to compile the template_fh project code? I can compile it without issues.
It compiles unless I write code that references the item with the error. I couldn't wait for an answer so I hard coded the enums and got rid of the error. I don't know the consequences.
I see the problem described above, in the proximity_fh project code as well as in the template where I first noticed it. Both compile and run fine. The valid question is: Even though there is a 'workaround' (hard code the enum values in the smpm.h file directly into the gap.h file), why are the references failing? Its bad practice to recklessly edit common code.