Komut
value()
Açıklama
Belirtilen BLEC karakteristiklerinin geçerli değerini sorgulayın .
Sözdizimi
bleCharacteristic.value ()
Parametreler
Yok
İadeler
Karakteristik , değer tipinin mevcut değeri kullanılan yapıcıya bağlıdır
Misal
…
// BLE LED Switch Characteristic - custom 128-bit UUID, read and writable by central
BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);
// …
if (switchCharacteristic.value()) { // any value other than 0
Serial.println("LED on");
digitalWrite(ledPin, HIGH); // will turn the LED on
} else { // a 0 value
Serial.println(F("LED off"));
digitalWrite(ledPin, LOW); // will turn the LED off
}
…
// BLE LED Switch Characteristic - custom 128-bit UUID, read and writable by central
BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);
// …
if (switchCharacteristic.value()) { // any value other than 0
Serial.println("LED on");
digitalWrite(ledPin, HIGH); // will turn the LED on
} else { // a 0 value
Serial.println(F("LED off"));
digitalWrite(ledPin, LOW); // will turn the LED off
}
…
See Also
- BLECharacteristic()
- uuid()
- properties()
- valueSize()
- valueLength()
- readValue()
- writeValue()
- setEventHandler()
- descriptorCount()
- hasDescriptor()
- descriptor()
- canRead()
- read()
- canWrite()
- canSubscribe()
- subscribe()
- canUnsubscribe()
- unsubscribe()
- valueUpdated()