swift - iOS CoreBluetooth print CBService and CBCharacteristic -


i using swift develop ios application integrate bluetooth printer print out information. have used corebluetooth framework can't know service, characteristic can writevalue print out

//find cbservice func peripheral(peripheral: cbperipheral!, diddiscoverservices error: nserror!) {     //println("cbperipheraldelegate diddiscoverservices")      service in peripheral.services {          println("service: discover service \(service)")         println("service: uuid \(service.uuid) ")          peripheral.discovercharacteristics(nil, forservice: service as! cbservice)      } }  //find cbcharacteristics func peripheral(peripheral: cbperipheral!, diddiscovercharacteristicsforservice service: cbservice!, error: nserror!) {      //if service.uuid == cbuuid(string: "18f0"){         characteristic in service.characteristics {              let chara: cbcharacteristic? = characteristic as? cbcharacteristic             println("char: service \(service.uuid) discover char \(chara)")             println("char: uuid \(chara!.uuid)")              peripheral.readvalueforcharacteristic(chara)              /*             println("0")              switch chara!.uuid {              case cbuuid(string: "2af1"):                 println("1")                  var rawarray:[uint8] = [0x01];                 let data = nsdata(bytes: &rawarray, length: rawarray.count)                  peripheral.writevalue(data, forcharacteristic: chara, type: cbcharacteristicwritetype.withoutresponse)              default: println("")             }             */         }     //}  } 

and system display result below:

service: discover service service: uuid battery service: discover service service: uuid 1803 service: discover service service: uuid 1802 service: discover service service: uuid 1811 service: discover service service: uuid 1804 service: discover service service: uuid 18f0 service: discover service service: uuid device information service: discover service service: uuid e7810a71-73ae-499d-8c15-faa9aef0c3f2

char: discover char char: uuid battery level char: discover char char: uuid 2a06 char: discover char char: uuid 2a06 char: discover char char: uuid 2a47 char: discover char char: uuid 2a46 char: discover char char: uuid 2a48 char: discover char char: uuid 2a45 char: discover char char: uuid 2a44 char: discover char char: uuid 2a07 char: discover char char: uuid 2af1 char: discover char char: uuid 2af0 char: discover char char: uuid system id char: discover char char: uuid manufacturer name string char: discover char char: uuid bef8d6c9-9c21-4c9e-b632-bd58c1009f9f

can bluetooth expert can guide me, thanks


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -