Skip to content

Commit

Permalink
Fix heartbeats not being sent
Browse files Browse the repository at this point in the history
  • Loading branch information
DerAndereAndi committed Feb 5, 2024
1 parent 280e5be commit 8f66375
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 0 additions & 5 deletions spine/entity_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ func (r *EntityLocal) GetOrAddFeature(featureType model.FeatureTypeType, role mo
f.SetDescriptionString(description)
r.features = append(r.features, f)

if role == model.RoleTypeServer && featureType == model.FeatureTypeTypeDeviceDiagnosis {
// Update HeartbeatManager
r.device.HeartbeatManager().SetLocalFeature(r, f)
}

return f
}

Expand Down
8 changes: 8 additions & 0 deletions spine/feature_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ func (r *FeatureLocal) AddFunctionType(function model.FunctionType, read, write
return
}
r.operations[function] = NewOperations(read, write)

if r.role == model.RoleTypeServer &&
r.ftype == model.FeatureTypeTypeDeviceDiagnosis &&
function == model.FunctionTypeDeviceDiagnosisHeartbeatData {
// Update HeartbeatManager
r.Device().HeartbeatManager().SetLocalFeature(r.Entity(), r)
}

}

func (r *FeatureLocal) AddResultHandler(handler api.FeatureResultInterface) {
Expand Down

0 comments on commit 8f66375

Please sign in to comment.