PIPluginBase * tmp = NULL;
LL_FOREACH_SAFE(pluginList, out, tmp)
{
- if(out)
+ result = DeletePlugin(out);
+ if (result != OC_STACK_OK)
{
- result = DeletePlugin(out);
- if (result != OC_STACK_OK)
- {
- break;
- }
+ break;
}
}
if (result == OC_STACK_OK)
PIResourceBase * tmp = NULL;
LL_FOREACH_SAFE(plugin->resourceList, out, tmp)
{
- if (out && out->piResource.resourceHandle == resourceHandle)
+ if (out->piResource.resourceHandle == resourceHandle)
{
*piResource = (PIResource *) out;
return OC_STACK_OK;
size_t indexLength = 0;
LL_FOREACH_SAFE(plugin->resourceList, out, tmp)
{
- if(out)
+ indexLength = strlen(((PIResource_Zigbee *)out)->nodeId);
+ if(ZigbeeStrEquals(nodeId,
+ ((PIResource_Zigbee *)out)->nodeId,
+ checkNodeIdLength,
+ indexLength) == false)
{
- indexLength = strlen(((PIResource_Zigbee *)out)->nodeId);
- if(ZigbeeStrEquals(nodeId,
- ((PIResource_Zigbee *)out)->nodeId,
- checkNodeIdLength,
- indexLength) == false)
- {
- continue;
- }
- indexLength = strlen(((PIResource_Zigbee *)out)->endpointId);
- if(ZigbeeStrEquals(endpointId,
- ((PIResource_Zigbee *)out)->endpointId,
- checkEndpointIdLength,
- indexLength) == false)
- {
- continue;
- }
- indexLength = strlen(((PIResource_Zigbee *)out)->clusterId);
- if(ZigbeeStrEquals(clusterId,
- ((PIResource_Zigbee *)out)->clusterId,
- checkClusterIdLength,
- indexLength) == false)
- {
- continue;
- }
- OIC_LOG_V(INFO, TAG, "Found a match! URI = %s", out->piResource.uri);
- *piResource = (PIResource_Zigbee *) out;
- return OC_STACK_OK;
+ continue;
+ }
+ indexLength = strlen(((PIResource_Zigbee *)out)->endpointId);
+ if(ZigbeeStrEquals(endpointId,
+ ((PIResource_Zigbee *)out)->endpointId,
+ checkEndpointIdLength,
+ indexLength) == false)
+ {
+ continue;
+ }
+ indexLength = strlen(((PIResource_Zigbee *)out)->clusterId);
+ if(ZigbeeStrEquals(clusterId,
+ ((PIResource_Zigbee *)out)->clusterId,
+ checkClusterIdLength,
+ indexLength) == false)
+ {
+ continue;
}
+ OIC_LOG_V(INFO, TAG, "Found a match! URI = %s", out->piResource.uri);
+ *piResource = (PIResource_Zigbee *) out;
+ return OC_STACK_OK;
}
*piResource = NULL;
return OC_STACK_NO_RESOURCE;
size_t checkLength = strlen(eui);
LL_FOREACH_SAFE(plugin->resourceList, out, tmp)
{
- if(out)
+ size_t indexLength = strlen(((PIResource_Zigbee *)out)->eui);
+ if(ZigbeeStrEquals(eui, ((PIResource_Zigbee *)out)->eui, checkLength, indexLength) != true)
{
- size_t indexLength = strlen(((PIResource_Zigbee *)out)->eui);
- if(ZigbeeStrEquals(eui, ((PIResource_Zigbee *)out)->eui, checkLength, indexLength) != true)
- {
- continue;
- }
- OICStrcpy(((PIResource_Zigbee *)out)->nodeId, (strlen(nodeId)+1)*sizeof(char), nodeId);
+ continue;
}
+ OICStrcpy(((PIResource_Zigbee *)out)->nodeId, (strlen(nodeId)+1)*sizeof(char), nodeId);
}
return OC_STACK_OK;
}
LL_FOREACH_SAFE(plugin->resourceList, out, tmp)
{
- if(out)
+ result = DeleteResource(plugin, out);
+ if (result != OC_STACK_OK)
{
- result = DeleteResource(plugin, out);
- if (result != OC_STACK_OK)
- {
- break;
- }
+ break;
}
}
if (result == OC_STACK_OK)