Skip to contentSkip to conversation

test/example-gatt-server: Fix few copy-paste errors

PATCH Applied Szymon Janc 2 participants 3 messages Sep 21, 2016 – Sep 22, 2016 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 test/example-gatt-server: Fix few copy-paste errors

---
 test/example-gatt-server | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
test/example-gatt-server +5 -5
index 44ceb70..ecf614f 100755
@@ -535,11 +535,11 @@ class TestEncryptCharacteristic(Characteristic):
                 CharacteristicUserDescriptionDescriptor(bus, 3, self))
 
     def ReadValue(self, options):
-        print('TestCharacteristic Read: ' + repr(self.value))
+        print('TestEncryptCharacteristic Read: ' + repr(self.value))
         return self.value
 
     def WriteValue(self, value, options):
-        print('TestCharacteristic Write: ' + repr(value))
+        print('TestEncryptCharacteristic Write: ' + repr(value))
         self.value = value
 
 class TestEncryptDescriptor(Descriptor):
@@ -576,16 +576,16 @@ class TestSecureCharacteristic(Characteristic):
                 ['secure-read', 'secure-write'],
                 service)
         self.value = []
-        self.add_descriptor(TestEncryptDescriptor(bus, 2, self))
+        self.add_descriptor(TestSecureDescriptor(bus, 2, self))
         self.add_descriptor(
                 CharacteristicUserDescriptionDescriptor(bus, 3, self))
 
     def ReadValue(self, options):
-        print('TestCharacteristic Read: ' + repr(self.value))
+        print('TestSecureCharacteristic Read: ' + repr(self.value))
         return self.value
 
     def WriteValue(self, value, options):
-        print('TestCharacteristic Write: ' + repr(value))
+        print('TestSecureCharacteristic Write: ' + repr(value))
         self.value = value
 
 
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 test/example-gatt-server: Make test service primary

This allows to test from Android until included services support is added.

---
 test/example-gatt-server | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
test/example-gatt-server +1 -1
index ecf614f..52c2029 100755
@@ -438,7 +438,7 @@ class TestService(Service):
     TEST_SVC_UUID = '12345678-1234-5678-1234-56789abcdef0'
 
     def __init__(self, bus, index):
-        Service.__init__(self, bus, index, self.TEST_SVC_UUID, False)
+        Service.__init__(self, bus, index, self.TEST_SVC_UUID, True)
         self.add_characteristic(TestCharacteristic(bus, 0, self))
         self.add_characteristic(TestEncryptCharacteristic(bus, 1, self))
         self.add_characteristic(TestSecureCharacteristic(bus, 2, self))
Signature · 1 line
2.7.4
maintainer Applied
#2 lore raw
In reply to Szymon Janc

Hi Szymon,

Quoted 43 lines · Szymon Janc
---
 test/example-gatt-server | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
test/example-gatt-server +5 -6
index 44ceb70..ecf614f 100755
@@ -535,11 +535,11 @@ class TestEncryptCharacteristic(Characteristic):
                 CharacteristicUserDescriptionDescriptor(bus, 3, self))
 
     def ReadValue(self, options):
-        print('TestCharacteristic Read: ' + repr(self.value))
+        print('TestEncryptCharacteristic Read: ' + repr(self.value))
         return self.value
 
     def WriteValue(self, value, options):
-        print('TestCharacteristic Write: ' + repr(value))
+        print('TestEncryptCharacteristic Write: ' + repr(value))
         self.value = value
 
 class TestEncryptDescriptor(Descriptor):
@@ -576,16 +576,16 @@ class TestSecureCharacteristic(Characteristic):
                 ['secure-read', 'secure-write'],
                 service)
         self.value = []
-        self.add_descriptor(TestEncryptDescriptor(bus, 2, self))
+        self.add_descriptor(TestSecureDescriptor(bus, 2, self))
         self.add_descriptor(
                 CharacteristicUserDescriptionDescriptor(bus, 3, self))
 
     def ReadValue(self, options):
-        print('TestCharacteristic Read: ' + repr(self.value))
+        print('TestSecureCharacteristic Read: ' + repr(self.value))
         return self.value
 
     def WriteValue(self, value, options):
-        print('TestCharacteristic Write: ' + repr(value))
+        print('TestSecureCharacteristic Write: ' + repr(value))
         self.value = value
 
 
--
Quoted 1 line

2.7.4

Applied, thanks.

Signature · 1 line
Luiz Augusto von Dentz