I am writing a OTA Client based on SampleSwitch. Latest Zstack with IAR 9.10
In my _data.c file I have following which is exatly same as code in data.c file of SampleSwitch:
SimpleDescriptionFormat_t myapp_SimpleDesc =
{
myapp_ENDPOINT, // int Endpoint;
ZCL_HA_PROFILE_ID, // uint16 AppProfId[2];
myapp_DEVICE_VERSION, // int AppDevVer:4;
myapp_FLAGS, // int AppFlags:4;
myapp_MAX_INCLUSTERS, // byte AppNumInClusters;
(cId_t *)myapp_InClusterList, // ERROR: Line 270
ZCLmyapp_MAX_OUTCLUSTERS, // ERROR; Line 271
(cId_t *)zclmyapp_OutClusterList // ERROR Line 272
};
IAR keeps giving this error which I don't understand why. Because types are all correct. Below is IAR error and type of variables it gives error on.
Error[Pe144]: a value of type "cId_t *" cannot be used to initialize an entity of type "uint8" \Source\myapp_data.c 270 Error[Pe144]: a value of type "unsigned int" cannot be used to initialize an entity of type "cId_t *" \Source\myapp_router_data.c 271 Error[Pe144]: a value of type "cId_t *" cannot be used to initialize an entity of type "uint8" \Source\myapp_data.c 272
Types:
typedef struct
{
uint8 EndPoint;
uint16 AppProfId;
uint16 AppDeviceId;
uint8 AppDevVer:4;
uint8 Reserved:4; // AF_V1_SUPPORT uses for AppFlags:4.
uint8 AppNumInClusters;
cId_t *pAppInClusterList;
uint8 AppNumOutClusters;
cId_t *pAppOutClusterList;
} SimpleDescriptionFormat_t;