Resolve "Add an option to send gNMI Subscribe requests via SBI"
Compare changes
- Fabian Seidl authored
+ 11
− 4
@@ -8,6 +8,7 @@ import (
@@ -8,6 +8,7 @@ import (
@@ -42,6 +43,10 @@ func NewDeviceWatcher(pndStore networkdomain.PndStore) *DeviceWatcher {
@@ -42,6 +43,10 @@ func NewDeviceWatcher(pndStore networkdomain.PndStore) *DeviceWatcher {
// SubToDevices subscribes to every available device in each network domain according to provided SubscribeOptions.
// SubscribeOptions can be nil. Use nil for a fixed, pre-defined set of gNMI subscription options (streaming in sample mode each second).
@@ -84,7 +89,7 @@ func (d *DeviceWatcher) callSubscribe(stopContext context.Context, pndID string,
@@ -84,7 +89,7 @@ func (d *DeviceWatcher) callSubscribe(stopContext context.Context, pndID string,
// SubscriptionInformation conatins pnd ID, device ID and name to be used in the internal subscribe to check
if err := device.Transport().SubscribeInternal(gNMIOptionsCtx, handleSubscribeResponse, &transport.SubscriptionInformation{
@@ -115,7 +120,7 @@ func (d *DeviceWatcher) StopAndRemoveDeviceSubscription(subID uuid.UUID) {
@@ -115,7 +120,7 @@ func (d *DeviceWatcher) StopAndRemoveDeviceSubscription(subID uuid.UUID) {
// handleSubscribeResponse takes the subscribe response and additional information about the device to distinguish
func handleSubscribeResponse(resp *gpb.SubscribeResponse, subscriptionInfo *transport.SubscriptionInformation) {
@@ -133,13 +138,15 @@ func handleSubscribeResponse(resp *gpb.SubscribeResponse, subscriptionInfo *tran
@@ -133,13 +138,15 @@ func handleSubscribeResponse(resp *gpb.SubscribeResponse, subscriptionInfo *tran
func handleSubscribeResponseUpdate(resp *gpb.SubscribeResponse_Update, subscriptionInfo *transport.SubscriptionInformation) {
log.Infof("Pnd: %s, Device: %s, Message: %s", subscriptionInfo.PndID, subscriptionInfo.DeviceID, resp.Update.String())