edgexfoundry / edgexfoundry/device-bacnet-c
Build Error Unknown type name ‘iot_typecode_t’ error on Raspberry pi
- Dominant language
- C
- Stars
- 16
- Forks
- 22
- Avg merge
- 21h 15m
- Merged PRs (30d)
- 1
Description
Hello,
I am trying to build this but got an error. I appreciate your help int this regard. Thank you
/root/device-sdk-c/include/devsdk/devsdk-base.h:48:3: error: unknown type name ‘iot_typecode_t’
48 | iot_typecode_t type;
| ^~~~~~~~~~~~~~
/root/device-sdk-c/include/devsdk/devsdk-base.h:94:3: error: unknown type name ‘iot_typecode_t’
94 | iot_typecode_t type;
| ^~~~~~~~~~~~~~
In file included from /root/device-sdk-c/include/edgex/devices.h:18,
from /root/device-bacnet-c/src/c/main.c:12:
/root/device-sdk-c/include/edgex/edgex.h:47:3: error: unknown type name ‘iot_typecode_t’
47 | iot_typecode_t type;
| ^~~~~~~~~~~~~~
/root/device-bacnet-c/src/c/main.c: In function ‘bacnet_alloc_exception’:
/root/device-bacnet-c/src/c/main.c:109:38: error: ‘IOT_DATA_TAKE’ undeclared (first use in this function); did you mean ‘IOT_DATA_MAP’?
109 | return iot_data_alloc_string (str, IOT_DATA_TAKE);
| ^~~~~~~~~~~~~
| IOT_DATA_MAP
/root/device-bacnet-c/src/c/main.c:109:38: note: each undeclared identifier is reported only once for each function it appears in
/root/device-bacnet-c/src/c/main.c: In function ‘parseProperty’:
/root/device-bacnet-c/src/c/main.c:162:69: error: ‘IOT_DATA_REF’ undeclared (first use in this function); did you mean ‘IOT_DATA_MAP’?
162 | *exc = iot_data_alloc_string ("Unknown BACnet property name", IOT_DATA_REF);
| ^~~~~~~~~~~~
| IOT_DATA_MAP
/root/device-bacnet-c/src/c/main.c: In function ‘parseType’:
/root/device-bacnet-c/src/c/main.c:189:69: error: ‘IOT_DATA_REF’ undeclared (first use in this function); did you mean ‘IOT_DATA_MAP’?
189 | *exc = iot_data_alloc_string ("Attribute 'type' is required", IOT_DATA_REF);
| ^~~~~~~~~~~~
| IOT_DATA_MAP
/root/device-bacnet-c/src/c/main.c: In function ‘get_supported_services’:
/root/device-bacnet-c/src/c/main.c:313:85: error: ‘IOT_DATA_REF’ undeclared (first use in this function); did you mean ‘IOT_DATA_MAP’?
313 | iot_data_string_map_add (properties, "DS-RPM-B", iot_data_alloc_string ("true", IOT_DATA_REF));
| ^~~~~~~~~~~~
| IOT_DATA_MAP
/root/device-bacnet-c/src/c/main.c: In function ‘bacnet_get_handler’:
/root/device-bacnet-c/src/c/main.c:443:71: error: ‘IOT_DATA_REF’ undeclared (first use in this function); did you mean ‘IOT_DATA_MAP’?
443 | *exception = iot_data_alloc_string ("Error populating read_data", IOT_DATA_REF);
| ^~~~~~~~~~~~
| IOT_DATA_MAP
/root/device-bacnet-c/src/c/main.c: In function ‘bacnet_put_handler’:
/root/device-bacnet-c/src/c/main.c:513:72: error: ‘IOT_DATA_REF’ undeclared (first use in this function); did you mean ‘IOT_DATA_MAP’?
513 | *exception = iot_data_alloc_string ("Error populating write_data", IOT_DATA_REF);
| ^~~~~~~~~~~~
| IOT_DATA_MAP
/root/device-bacnet-c/src/c/main.c: In function ‘main’:
/root/device-bacnet-c/src/c/main.c:668:101: error: ‘IOT_DATA_REF’ undeclared (first use in this function); did you mean ‘IOT_DATA_MAP’?
668 | iot_data_string_map_add (defaults, "DefaultDevicePath", iot_data_alloc_string (DEFAULT_MSTP_PATH, IOT_DATA_REF));
| ^~~~~~~~~~~~
| IOT_DATA_MAP
/root/device-bacnet-c/src/c/main.c: In function ‘bacnet_alloc_exception’:
/root/device-bacnet-c/src/c/main.c:110:1: warning: control reaches end of non-void function [-Wreturn-type]
110 | }
| ^
make[2]: *** [CMakeFiles/device-bacnet-c.dir/build.make:76: CMakeFiles/device-bacnet-c.dir/main.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:111: CMakeFiles/device-bacnet-c.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
Contributor guide
Research direction
Start by reproducing the Raspberry Pi build and inspect include/devsdk/devsdk-base.h, include/edgex/edgex.h, and src/c/main.c. Trace where iot_typecode_t, IOT_DATA_TAKE, and IOT_DATA_REF are defined or expected, then compare those dependencies with the versions used by the project. Done means the device-bacnet-c target builds without these errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cmake, raspberry-pi
- Domain
- build-system, embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100