Azure / dps-keygen

Helper tool to deal with the device keys :closed_lock_with_key:
MIT License
24 stars 16 forks source link

Can't build this example, prov_dev_set_symmetric_key_info not declared #3

Closed hamburml closed 5 years ago

hamburml commented 6 years ago

I used the azure-iot-sdk-c (2018-10-03 tag) and placed the code.c content into the prov_dev_client_ll_sample.c file. I compiled it but I get an error.

[ 97%] Built target iothub_convenience_sample
/home/odroid/azure-iot-sdk-c/provisioning_client/samples/prov_dev_client_ll_sample/prov_dev_client_ll_sample.c: In function 'main':
/home/odroid/azure-iot-sdk-c/provisioning_client/samples/prov_dev_client_ll_sample/prov_dev_client_ll_sample.c:148:5: error: implicit declaration of function 'prov_dev_set_symmetric_key_info'; did you mean 'prov_dev_security_init'? [-Werror=implicit-function-declaration]
     prov_dev_set_symmetric_key_info(reg_id, g_access_key);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     prov_dev_security_init
In file included from /home/odroid/azure-iot-sdk-c/c-utility/inc/azure_c_shared_utility/umock_c_prod.h:23:0,
...

Where is the prov_dev_set_symmetric_key_info() declared? I can't find that. I am also unable to find it in the whole azure iot sdk.

Could you please fix this? This is necessary for using IoT Central, because we need the connection string which we get by the device provision service.

Thanks!

hamburml commented 5 years ago

Looks like I used the wrong branch. I thought the C-SDK does already support IoT Central out of the box and used the 2018-10-03 tag. Should have used the dps_symm_key branch. But I don't like the idea of using a branch which isn't the "real thing" if you know what I mean.

@obastemur Do you know when this will be merged in the real version?

obastemur commented 5 years ago

At the moment, please follow the steps from https://github.com/Azure/dps-keygen/tree/master/bin#how-to-use-azure-iot-dps-symm-key-interface-for-azure-iot-c-sdk

AFAIK, dps symmkey changes for Azure IoT SDK will be on master very soon.