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

meta_info结构体参数在IOT_Linkkit_Open中没有任何作用,用户无法在应用层传入四元组 #144

Open
xiongyu0523 opened this issue May 1, 2019 · 1 comment

Comments

@xiongyu0523
Copy link

尝试运行linkkit_example_solo.c例程,根据CSDK快速体验中的描述:
“注:用户也可以不用修改这些全局变量,而是直接修改HAL_GetProductKey()等函数返回设备身份信息。”

尝试在main.c中给四元组赋值,并且屏蔽283-286行。结果发现设备连接有问题,能连上但物模型不正确,在控制台也看不到设备上线。

    HAL_GetProductKey(PRODUCT_KEY);
    HAL_GetProductSecret(PRODUCT_SECRET);
    HAL_GetDeviceName(DEVICE_NAME);
    HAL_GetDeviceSecret(DEVICE_SECRET);

最后发现是不管应用层传什么东西给IOT_Linkkit_Open(),在实现里都会不会用到,转而使用HAL_GetXXX()函数去获取四元组。

此设计容易给人误解,应用层该具备override的能力

@fenghr1219
Copy link

@xiongyu0523
下面的这四个HAL没有实现吧,IOT_Linkkit_Open内部会使用下面的代码Override掉四元组的

    HAL_SetProductKey(meta_info->product_key);
    HAL_SetProductSecret(meta_info->product_secret);
    HAL_SetDeviceName(meta_info->device_name);
    HAL_SetDeviceSecret(meta_info->device_secret);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants