Code Review
/
ric-plt
/
e2mgr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Update release version to 4.4.2
[ric-plt/e2mgr.git]
/
E2Manager
/
managers
/
ran_setup_manager.go
diff --git
a/E2Manager/managers/ran_setup_manager.go
b/E2Manager/managers/ran_setup_manager.go
index
40b4d00
..
f855df4
100644
(file)
--- a/
E2Manager/managers/ran_setup_manager.go
+++ b/
E2Manager/managers/ran_setup_manager.go
@@
-29,6
+29,7
@@
import (
"e2mgr/services"
"e2mgr/services/rmrsender"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
"e2mgr/services"
"e2mgr/services/rmrsender"
"gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
+ "unsafe"
)
type RanSetupManager struct {
)
type RanSetupManager struct {
@@
-37,6
+38,10
@@
type RanSetupManager struct {
rmrSender *rmrsender.RmrSender
}
rmrSender *rmrsender.RmrSender
}
+type IRanSetupManager interface {
+ ExecuteSetup(nodebInfo *entities.NodebInfo, status entities.ConnectionStatus) error
+}
+
func NewRanSetupManager(logger *logger.Logger, rmrSender *rmrsender.RmrSender, rnibDataService services.RNibDataService) *RanSetupManager {
return &RanSetupManager{
logger: logger,
func NewRanSetupManager(logger *logger.Logger, rmrSender *rmrsender.RmrSender, rnibDataService services.RNibDataService) *RanSetupManager {
return &RanSetupManager{
logger: logger,
@@
-49,12
+54,11
@@
func NewRanSetupManager(logger *logger.Logger, rmrSender *rmrsender.RmrSender, r
func (m *RanSetupManager) updateConnectionStatus(nodebInfo *entities.NodebInfo, status entities.ConnectionStatus) error {
// Update retries and connection status
nodebInfo.ConnectionStatus = status
func (m *RanSetupManager) updateConnectionStatus(nodebInfo *entities.NodebInfo, status entities.ConnectionStatus) error {
// Update retries and connection status
nodebInfo.ConnectionStatus = status
- nodebInfo.ConnectionAttempts++
err := m.rnibDataService.UpdateNodebInfo(nodebInfo)
if err != nil {
m.logger.Errorf("#RanSetupManager.updateConnectionStatus - Ran name: %s - Failed updating RAN's connection status to %v : %s", nodebInfo.RanName, status, err)
} else {
err := m.rnibDataService.UpdateNodebInfo(nodebInfo)
if err != nil {
m.logger.Errorf("#RanSetupManager.updateConnectionStatus - Ran name: %s - Failed updating RAN's connection status to %v : %s", nodebInfo.RanName, status, err)
} else {
- m.logger.Infof("#RanSetupManager.updateConnectionStatus - Ran name: %s - Successfully updated rNib. RAN's current connection status: %v
, RAN's current connection attempts: %d", nodebInfo.RanName, status, nodebInfo.ConnectionAttempt
s)
+ m.logger.Infof("#RanSetupManager.updateConnectionStatus - Ran name: %s - Successfully updated rNib. RAN's current connection status: %v
", nodebInfo.RanName, statu
s)
}
return err
}
}
return err
}
@@
-63,12
+67,11
@@
func (m *RanSetupManager) updateConnectionStatus(nodebInfo *entities.NodebInfo,
func (m *RanSetupManager) updateConnectionStatusDisconnected(nodebInfo *entities.NodebInfo) error {
// Update retries and connection status
nodebInfo.ConnectionStatus = entities.ConnectionStatus_DISCONNECTED
func (m *RanSetupManager) updateConnectionStatusDisconnected(nodebInfo *entities.NodebInfo) error {
// Update retries and connection status
nodebInfo.ConnectionStatus = entities.ConnectionStatus_DISCONNECTED
- nodebInfo.ConnectionAttempts--
err := m.rnibDataService.UpdateNodebInfo(nodebInfo)
if err != nil {
m.logger.Errorf("#RanSetupManager.updateConnectionStatusDisconnected - Ran name: %s - Failed updating RAN's connection status to DISCONNECTED : %s", nodebInfo.RanName, err)
} else {
err := m.rnibDataService.UpdateNodebInfo(nodebInfo)
if err != nil {
m.logger.Errorf("#RanSetupManager.updateConnectionStatusDisconnected - Ran name: %s - Failed updating RAN's connection status to DISCONNECTED : %s", nodebInfo.RanName, err)
} else {
- m.logger.Infof("#RanSetupManager.updateConnectionStatusDisconnected - Ran name: %s - Successfully updated rNib. RAN's current connection status: DISCONNECTED
, RAN's current connection attempts: %d", nodebInfo.RanName, nodebInfo.ConnectionAttempts
)
+ m.logger.Infof("#RanSetupManager.updateConnectionStatusDisconnected - Ran name: %s - Successfully updated rNib. RAN's current connection status: DISCONNECTED
", nodebInfo.RanName
)
}
return err
}
}
return err
}
@@
-105,7
+108,9
@@
func (m *RanSetupManager) ExecuteSetup(nodebInfo *entities.NodebInfo, status ent
}
// Send the endc/x2 setup request
}
// Send the endc/x2 setup request
- msg := models.NewRmrMessage(rmrMsgType, nodebInfo.RanName, request.GetMessageAsBytes(m.logger))
+ var xAction []byte
+ var msgSrc unsafe.Pointer
+ msg := models.NewRmrMessage(rmrMsgType, nodebInfo.RanName, request.GetMessageAsBytes(m.logger), xAction, msgSrc)
err = m.rmrSender.Send(msg)
err = m.rmrSender.Send(msg)