BLE input validation

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
ChrisO
Posts: 48
Joined: Mon Apr 06, 2020 6:16 pm

BLE input validation

Post by ChrisO » Wed Mar 16, 2022 10:19 am

Hi,

I'd like my sensors classes to be configurable via MQTT and BLE.
I'm new to BLE and I am having a hard time figuring out how input validation is usually handled.
I've found 0x2906 which is described as "valid range" although, there does not seem to be any further indication on how to use it.

Ideally I will build the validation into the sensor class and reuse it for both MQTT and BLE.
For the time being I control both the BLE client/server as well as the BLE peripheral, so I could make a custom "error characteristic" and write to there. I'm asking about best practices because the plan is, for future customers to be able to write their own app and connect to the peripheral.


regards,
Chris
Chris

Post Reply