0001    //
0002    //  BlueSocketProtocols.swift
0003    //  BlueSocket
0004    //
0005    //  Created by Bill Abt on 1/7/16.
0006    //  Copyright © 2016 IBM. All rights reserved.
0007    //
0008    // 	Licensed under the Apache License, Version 2.0 (the "License");
0009    // 	you may not use this file except in compliance with the License.
0010    // 	You may obtain a copy of the License at
0011    //
0012    // 	http://www.apache.org/licenses/LICENSE-2.0
0013    //
0014    // 	Unless required by applicable law or agreed to in writing, software
0015    // 	distributed under the License is distributed on an "AS IS" BASIS,
0016    // 	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0017    // 	See the License for the specific language governing permissions and
0018    // 	limitations under the License.
0019    //
0020    
0021    import Foundation
0022    
0023    // MARK: BlueSocketReader
0024    
0025    public protocol BlueSocketReader
BlueSocket.swift:88
public class BlueSocket: BlueSocketReader, BlueSocketWriter {
{ 0026 0027 /// 0028 /// Reads a string. 0029 /// 0030 /// - Returns: Optional String 0031 /// 0032 func readString() throws -> String? 0033 0034 /// 0035 /// Reads all available data 0036 /// 0037 /// - Parameter data: NSMutableData object to contain read data. 0038 /// 0039 /// - Returns: Integer representing the number of bytes read. 0040 /// 0041 func readData(data: NSMutableData) throws -> Int 0042 } 0043 0044 // MARK: BlueSocketWriter 0045 0046 public protocol BlueSocketWriter
BlueSocket.swift:88
public class BlueSocket: BlueSocketReader, BlueSocketWriter {
{ 0047 0048 /// 0049 /// Writes data 0050 /// 0051 /// - Parameter data: NSData object containing the data to be written. 0052 /// 0053 func writeData(data: NSData) throws 0054 0055 /// 0056 /// Writes a string 0057 /// 0058 /// - Parameter string: String data to be written. 0059 /// 0060 func writeString(string: String) throws 0061 }