 				print("Sent command: " +
 					(NSString(data: data, encoding: String.Encoding.utf8.rawValue)! as String))
 			}
+			else {
+				print("Sent non-command mode message")
+			}
+		}
+		else{
+			print("Not connected")
 		}
     }
     

			self.sendData(data: Data(HummingbirdPeripheral.ADALE_COMMAND_MODE_TOGGLE.utf8))
			Thread.sleep(forTimeInterval: 0.1)
			self.commandMode = false
		}
	}
	

		
		
		//Check the name
//		self.enterCommandMode()
//		self.resettingName = true
//		self.macStr = "1234567Adafruit Bluefruit LE"
//		self.resetNameFromMAC()
//		
//		print(self.peripheral.name!)
		
		if HummingbirdPeripheral.nameNeedsReset(self.peripheral.name!) {
			NSLog("Deciding to reset hummingbird name")
			self.resettingName = true
