File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
adafruit_ble/characteristics Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 6
6
`json`
7
7
====================================================
8
8
9
- This module provides Json characteristic.
9
+ This module provides JSON characteristic.
10
10
11
11
"""
12
12
18
18
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_BLE.git"
19
19
20
20
21
- class JsonCharacteristic (Characteristic ):
22
- """Json string characteristic for JSON serializable values of a limited size (max_length)."""
21
+ class JSONCharacteristic (Characteristic ):
22
+ """JSON string characteristic for JSON serializable values of a limited size (max_length)."""
23
23
24
24
def __init__ (
25
25
self ,
Original file line number Diff line number Diff line change 2
2
#
3
3
# SPDX-License-Identifier: MIT
4
4
5
- # Provide readable sensor values and writable settings to connected devices via Json characteristic.
5
+ # Provide readable sensor values and writable settings to connected devices via JSON characteristic.
6
6
7
7
import time
8
8
import random
Original file line number Diff line number Diff line change 1
1
from adafruit_ble .uuid import VendorUUID
2
2
from adafruit_ble .services import Service
3
3
from adafruit_ble .characteristics import Characteristic
4
- from adafruit_ble .characteristics .json import JsonCharacteristic
4
+ from adafruit_ble .characteristics .json import JSONCharacteristic
5
5
6
6
7
- # A custom service with two Json characteristics for this device. The "sensors" characteristic
7
+ # A custom service with two JSON characteristics for this device. The "sensors" characteristic
8
8
# provides updated sensor values for any connected device to read. The "settings" characteristic
9
9
# can be changed by any connected device to update the peripheral's settings. The UUID of your
10
10
# service can be any valid random uuid (some BLE UUID's are reserved).
11
- # NOTE: Json data is limited by characteristic max_length of 512 byes.
11
+ # NOTE: JSON data is limited by characteristic max_length of 512 byes.
12
12
class SensorService (Service ):
13
13
uuid = VendorUUID ("51ad213f-e568-4e35-84e4-67af89c79ef0" )
14
14
15
- settings = JsonCharacteristic (
15
+ settings = JSONCharacteristic (
16
16
uuid = VendorUUID ("e077bdec-f18b-4944-9e9e-8b3a815162b4" ),
17
17
properties = Characteristic .READ | Characteristic .WRITE ,
18
18
initial_value = {
19
19
'unit' : 'celsius'
20
20
}
21
21
)
22
22
23
- sensors = JsonCharacteristic (
23
+ sensors = JSONCharacteristic (
24
24
uuid = VendorUUID ("528ff74b-fdb8-444c-9c64-3dd5da4135ae" ),
25
25
properties = Characteristic .READ ,
26
26
)
You can’t perform that action at this time.
0 commit comments