반응형
//read
devicePeripheral.readValue(for: characteristic)
//write
var parameter = NSInteger(0x31)
let data = Data(bytes: ¶meter, count: 1)
devicePeripheral.writeValue(data, for: characteristic, type: .withResponse)
연결된 peripheral 의 characteristic 은 배열에 따로 저장해 두자.
'iOS' 카테고리의 다른 글
[Swift] NotificationCenter (0) | 2022.01.12 |
---|---|
[Swift] Substring (0) | 2022.01.12 |
[Swift] contentView - expandable tableView (0) | 2022.01.02 |
[Swift] Google Admob 추가 (0) | 2021.12.24 |
[Swift] modalPresentationStyle (0) | 2021.12.24 |