So, following the docs, I am able to compile a custom HSM lib and link it to the sdk, and doing that, if I run the sample provided in prov_dev_client_sample with the certs in the same cmake directory (i.e azure-iot-sdk-c/cmake/*). But I created a new project and wanted to use the sample to start off and i get no errors in compiling, but when I run the code out of the repo. it gives me the below error
Error: Time:Fri Oct 30 11:19:56 2020 File:/build/azure-iot-sdk-c-aYsk0M/azure-iot-sdk-c-0.2.0.0/provisioning_client/src/prov_security_factory.c Func:prov_dev_security_init Line:63 HSM type 2 is not supported on this SDK build
Provisioning API Version: 1.3.9
Error: Time:Fri Oct 30 11:19:56 2020 File:/build/azure-iot-sdk-c-aYsk0M/azure-iot-sdk-c-0.2.0.0/provisioning_client/src/prov_auth_client.c Func:prov_auth_create Line:298 hsm_client_create is not a valid address
Error: Time:Fri Oct 30 11:19:56 2020 File:/home/peekay/playground/azure-iot-sdk-c/provisioning_client/src/prov_device_ll_client.c Func:Prov_Device_LL_Create Line:897 failed calling prov_auth_create
Error: Time:Fri Oct 30 11:19:56 2020 File:/home/peekay/playground/azure-iot-sdk-c/provisioning_client/src/prov_device_client.c Func:Prov_Device_Create Line:124 Prov_Device_LL_Create failed
failed calling Prov_Device_Create
Press enter key to exit:
This is my corresponding cmake file
cmake_minimum_required(VERSION 3.16)
project(reader_simulation_azure C)
set(CMAKE_C_STANDARD 99)
set(AZUREIOT_INC_FOLDER ".." "." "./deps/parson" "/usr/local/include/azureiot" "/usr/local/include/azureiot/inc")
include_directories(${AZUREIOT_INC_FOLDER})
add_executable(reader_simulation_azure main.c)
target_link_libraries(reader_simulation_azure
uuid
prov_mqtt_transport
prov_device_client
prov_device_ll_client
prov_auth_client
hsm_security_client
uhttp
iothub_client
iothub_client_mqtt_transport
umqtt
aziotsharedutil
ssl
pthread
curl
ssl
crypto
m
parson
)
upon checking I see that the Cmake file in the repo has the cmake flags needed to enable these and my code does not. any help as to what needs to change and what is going wrong would mean a lot.
Thanks in advance