Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Api updates for the discovery api changes in C SDK including ev… #1374

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions docs_src/microservices/device/sdk/api/CDeviceSDK/CDeviceSDKAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,18 @@ Implementations should perform a scan for devices, and use the `devsdk_add_disco
Parameter | Type | Description
----------|------|------------
impl | void* | The context data passed in when the service was created
request_id | const char* | The discovery request ID

### devsdk_discovery_delete

This function is called when a delete request for discovery is made.

Implementations should perform logic for stopping a discovery request that is in progress. The implementation should return True on success or False for unsuccessful.

Parameter | Type | Description
----------|------|------------
impl | void* | The context data passed in when the service was created
request_id | const char* | The discovery request ID

### devsdk_describe

Expand All @@ -289,6 +301,15 @@ cb | devsdk_callbacks* | structure to be modified
discover | devsdk_discover | device discovery function
describe | devsdk_describe | device description function, may be NULL (currently unused)

### devsdk_callbacks_set_discovery_delete

Call this to add your discovery delete function to the callbacks structure

Parameter | Type | Description
----------|------|------------
cb | devsdk_callbacks* | structure to be modified
discover | devsdk_discovery_delete | device discovery delete function

### devsdk_add_device_callback

To be notified when a device is added to the system (and assigned to this device service), provide an implementation of this function
Expand Down Expand Up @@ -530,3 +551,24 @@ Parameter | Type | Description
----------|------|------------
svc | devsdk_service_t* | The device service
d | devsdk_devices* | The device or device list

### devsdk_publish_discovery_event

Publish a system event for discovery. Events will be published to "edgex.system-event.(service-name).device.discovery".

Parameter | Type | Description
----------|------|------------
svc | devsdk_service_t* | The device service
request_id | const char* | The discovery request ID
progress | const int8 | Progress value (percent complete)
discovered_devices | uint64 | The number of discovered devices

### devsdk_publish_system_event

Publish a generic system event. Events will be published to "edgex.system-event.(service-name).device.(action)".

Parameter | Type | Description
----------|------|------------
svc | devsdk_service_t* | The device service
action | const char* | The action that triggered the event to be used in the topic name
details | iot_data_t* | A map of parameters to be published in the event details