X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=E2Manager%2Fmanagers%2Fran_setup_manager.go;h=f855df4d2d86287d8f1b7c25f9815c14342bd1a8;hb=a07b8597afc9d063a7f37a376a5bcf29ba29b557;hp=35908a7a37249f1d16c784dfdb219e3cb1b415b8;hpb=de19068aaa1f3d2b415cd960106121ceb167aaa9;p=ric-plt%2Fe2mgr.git diff --git a/E2Manager/managers/ran_setup_manager.go b/E2Manager/managers/ran_setup_manager.go index 35908a7..f855df4 100644 --- a/E2Manager/managers/ran_setup_manager.go +++ b/E2Manager/managers/ran_setup_manager.go @@ -13,7 +13,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// + +// This source code is part of the near-RT RIC (RAN Intelligent Controller) +// platform project (RICP). + package managers @@ -26,6 +29,7 @@ import ( "e2mgr/services" "e2mgr/services/rmrsender" "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities" + "unsafe" ) type RanSetupManager struct { @@ -34,6 +38,10 @@ type RanSetupManager struct { 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, @@ -46,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 - 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 { - 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.ConnectionAttempts) + m.logger.Infof("#RanSetupManager.updateConnectionStatus - Ran name: %s - Successfully updated rNib. RAN's current connection status: %v", nodebInfo.RanName, status) } return err } @@ -60,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 - 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 { - 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 } @@ -102,7 +108,9 @@ func (m *RanSetupManager) ExecuteSetup(nodebInfo *entities.NodebInfo, status ent } // 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)