i am calling peripheral services methods are not getting called

i am calling peripheral services methods are not getting called

var connectedDevice: CBPeripheral?

 

func discoverServices()

    {

       

         

            self.connectedDevice?.delegate = self

            self.connectedDevice?.discoverServices(nil)

     

    }

 

    /

 

    func peripheral(peripheral: CBPeripheral, didDiscoverCharacteristicsForService service: CBService, error: NSError?)

    {

     

        let charac = service.characteristics!

        peripheralCharacteristics.addObjectsFromArray(charac)

        peripheral.setNotifyValue(true, forCharacteristic: charac[0])

    }

 

 

 

    func peripheral(peripheral: CBPeripheral, didDiscoverServices error: NSError?)

    {

        if error != nil || peripheral.services?.count > 0

        {

            if let services = peripheral.services

            {

                peripheralServices.addObjectsFromArray(services)

                peripheral.discoverCharacteristics(nil, forService: services[1])

            }else

            {

                print(“No Services Found”)

            }

        }else

        {

            print(error?.localizedDescription)

        }

     

    }

 

    func peripheral(peripheral: CBPeripheral, didUpdateValueForCharacteristic characteristic: CBCharacteristic, error: NSError?)

    {

        var message = “”

        let fullString = self.removeSpecialCharsFromString((characteristic.value?.description.capitalizedString)!)

        let rfidList = self.separateRfids(fullString)

     

        for value in rfidList{

            if  (value as! String) == rfid {

                readRfids[rfid] = 1.0

            }

            rfid = (value as! String)

         

            if readRfids[rfid] == nil{

                readRfids[rfid] = 1.0

                if CoreDataManager().isRfidRegistered(rfid) != “none”{

                    if CoreDataManager().isItemInBag(rfid){

                        if CoreDataManager().removeItemFromBag(rfid){

                            message = “\(CoreDataManager().getNameFromRfid(rfid)) Removed”

                        }

                    }else{

                        if CoreDataManager().addItemToBag(rfid){

                            message = “\(CoreDataManager().getNameFromRfid(rfid)) Added”

                        }

                    }

                    notification.fireDate = NSDate(timeIntervalSinceNow: 0.1)

                    notification.alertTitle = “Item Detected”

                    notification.alertBody = message

                    notification.alertAction = “Open App”

                    notification.soundName = UILocalNotificationDefaultSoundName

                    if UIApplication.sharedApplication().applicationState == .Background{

                        badge = badge + 1

                        UIApplication.sharedApplication().applicationIconBadgeNumber = badge

                    }

                    UIApplication.sharedApplication().scheduleLocalNotification(notification)

             

                }else{

                    if !newRfids.containsObject(rfid){

                        newRfids.addObject(rfid)

                    }

                    notification.fireDate = NSDate(timeIntervalSinceNow: 0.1)

                    notification.alertTitle = “Item Detected”

                    notification.alertBody = “New RFID Tag Detected. Register it.”

                    notification.alertAction = “Open App”

                    notification.soundName = UILocalNotificationDefaultSoundName

                    if UIApplication.sharedApplication().applicationState == .Background{

                        badge = badge + 1

                        UIApplication.sharedApplication().applicationIconBadgeNumber = badge

                    }

                    UIApplication.sharedApplication().scheduleLocalNotification(notification)

                }

            }

        }

    }

 

    func peripheral(peripheral: CBPeripheral, didUpdateNotificationStateForCharacteristic characteristic: CBCharacteristic, error: NSError?)

    {

        if error == nil{

            /

        }else{

            print(error?.localizedDescription)

        }

    }