 	}
 
 	/**
-	快速构造方法
+	Convenient initializer
 
-	- parameter data:           待写入的数据
-	- parameter characteristic: 待写值的特征
-	- parameter peripheral:     从设备对象
-	- parameter success:        写值成功的回调
-	- parameter failure:        写值失败的回调
+	- parameter data:           a NSData object to be written
+	- parameter characteristic: a CBCharacteristic object on which the data will be written
+	- parameter peripheral:     a CBPeripheral object to which the characteristic belongs
+	- parameter success:        a closure called when value written successfully
+	- parameter failure:        a closure called when value written failed
 
-	- returns: 返回一个WriteRequest对象
+	- returns: a WriteRequest instance
 	*/
-	convenience init(data: NSData?, characteristic: CBCharacteristic?, peripheral: CBPeripheral, success: ((Response?) -> Void)?, failure: ((NSError?) -> Void)?) {
+	convenience init(data: NSData?, characteristic: Characteristic, peripheral: Peripheral, success: ((Response?) -> Void)?, failure: ((NSError?) -> Void)?) {
 		self.init()
         self.data           = data
         self.characteristic = characteristic

	}

	override internal var hash: Int {
		return self.peripheral.hashValue
	}

	override internal func isEqual(object: AnyObject?) -> Bool {
		if let other = object as? ServiceDiscoveringRequest {
			return self.peripheral == other.peripheral
		}
		return false
	}
	
}

// MARK: Communicate
extension Cusp {

	/**
	写值

	- parameter data:           待写入的数据;
	- parameter characteristic: 特征;
	- parameter peripheral:     从设备;
	- parameter success:        写值成功的回调;
	- parameter failure:        写值失败的回调;
	*/
	public func write(data: NSData, forCharacteristic characteristic: CBCharacteristic, inPeripheral peripheral: CBPeripheral, success: ((Response?) -> Void)?, failure: ((NSError?) -> Void)?) {
		dispatch_async(self.mainQ) { () -> Void in
			let req = WriteRequest(data: data, characteristic: characteristic, peripheral: peripheral, success: success, failure: failure)
			self.writeRequests.insert(req)

			if let session = self.sessionFor(peripheral) {
				dispatch_async(session.sessionQ, { () -> Void in
					peripheral.writeValue(data, forCharacteristic: characteristic, type: CBCharacteristicWriteType.WithResponse)
				})
			}
		}

//

import Foundation

/// request of write value to specific characteristic
internal class WriteRequest: OperationRequest {

	// MARK: Stored Properties

	/// a NSData object to be written
	internal var data: NSData?

	/// a CBCharacteristic object on which the data will be written
	internal var characteristic: Characteristic!

	// MARK: Initializer

