Closed David-Afik closed 11 months ago
If I have understood correctly then your read_value
function needs to look something like this:
def read_value():
cpu_value = random.randrange(3200, 5310, 10)
cpu_temp = random.randrange(1, 10000, 48)
return struct.pack('<hh', cpu_value, cpu_temp)
Take a look at the GATT Specification Supplement. Lots of good stuff in there about characteristics. The sections I would suggest to start with are:
2.3 Values and represented values .................................................................................................. 16 2.3.1 Interpretation of values .................................................................................................................... 16 2.3.2 Scalar values ................................................................................................................................... 16 2.4 Octet and bit ordering ................................................................................................................. 17 2.5 Endianness ................................................................................................................................. 17
I will try
Thank you
Closing because of inactivity
Hello, I'm trying to create 2 chrcs in the same service
so I have created a second service , and I want to use the same update_value function
I don't want it to enter\run the function twice (one for each data - it's unnecessary)
is this a standard \ normal question ?
Thanks ,
***if we take the temperature example , I have created 2 random values in on the same read_value function - but what and how I need to return it ?
Thanks ,