Skip to content

Commit

Permalink
fix: update devsdk_post_readings to alloc and free correction id
Browse files Browse the repository at this point in the history
fix #464

Also update the file monitor example to v3

Signed-off-by: FelixTing <[email protected]>
  • Loading branch information
FelixTing committed Jul 20, 2023
1 parent ba5e076 commit 4f8820a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/c/examples/file/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ deliver events asynchronously.
The environment variable CSDK_DIR should be set to a directory containing the
C SDK include files and libraries.

Set LD_LIBRARY_PATH to $CSDK_DIR/lib
Set LD_LIBRARY_PATH to $CSDK_DIR/lib:/opt/iotech/iot/1.5/lib

### Building

```
gcc -I$CSDK_DIR/include -L$CSDK_DIR/lib -o device-file device-file.c -lcsdk
gcc -I$CSDK_DIR/include -I/opt/iotech/iot/1.5/include -L$CSDK_DIR/lib -L/opt/iotech/iot/1.5/lib -o device-file device-file.c -lcsdk -liot
```

### Device Profile
Expand Down
2 changes: 2 additions & 0 deletions src/c/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,7 @@ void devsdk_post_readings

if (event)
{
edgex_device_alloc_crlid (NULL);
if (svc->config.device.maxeventsize && edgex_event_cooked_size (event) > svc->config.device.maxeventsize * 1024)
{
iot_log_error (svc->logger, "Post readings: Event size (%d KiB) exceeds configured MaxEventSize", edgex_event_cooked_size (event) / 1024);
Expand All @@ -1062,6 +1063,7 @@ void devsdk_post_readings
devsdk_error err = EDGEX_OK;
edgex_metadata_client_update_lastconnected (svc->logger, &svc->config.endpoints, svc->secretstore, devname, &err);
}
edgex_device_free_crlid();
}
}
else
Expand Down

0 comments on commit 4f8820a

Please sign in to comment.