9 inline bool buildMaxGateCommand(
byte* out,
byte maxMotionGate,
byte maxStationaryGate,
unsigned short noOneTimeout) {
11 if (maxMotionGate < 2 || maxMotionGate > 8)
return false;
12 if (maxStationaryGate < 2 || maxStationaryGate > 8)
return false;
16 out[6] = maxMotionGate;
17 out[12] = maxStationaryGate;
19 memcpy(&out[18], &noOneTimeout, 2);
27 if (gate > 8 && gate != 0xFF)
return false;
41 if (movingThreshold > 100) movingThreshold = 100;
42 if (stationaryThreshold > 100) stationaryThreshold = 100;
44 out[12] = movingThreshold;
45 out[18] = stationaryThreshold;
71 out[4] = byte(lightControl);
72 out[5] = lightThreshold;
73 out[6] = byte(outputControl);
79 if (baudRateSetting < 1 || baudRateSetting > 8)
return false;
80 out[4] = baudRateSetting;
85 if (!password)
return false;
86 size_t len = strlen(password);
87 if (len > 6)
return false;
92 for (
unsigned int i = 0; i < 6; i++) {
93 if (i < strlen(password))
94 out[4 + i] = byte(password[i]);
96 out[4 + i] = byte(
' ');
bool buildMaxGateCommand(byte *out, byte maxMotionGate, byte maxStationaryGate, unsigned short noOneTimeout)
bool buildDistanceResolutionCommand(byte *out, LD2410Types::DistanceResolution resolution)
bool buildAuxControlCommand(byte *out, LD2410Types::LightControl lightControl, byte lightThreshold, LD2410Types::OutputControl outputControl)
bool buildGateSensitivityCommand(byte *out, byte gate, byte movingThreshold, byte stationaryThreshold)
bool buildBluetoothPasswordCommand(byte *out, const char *password)
bool buildBaudRateCommand(byte *out, byte baudRateSetting)
constexpr byte setAuxControlSettingCommandData[8]
constexpr byte distanceGateSensitivityConfigCommandData[0x16]
constexpr byte setBluetoothPasswordCommandData[10]
constexpr byte setDistanceResolution20cmCommandData[6]
constexpr byte maxGateCommandData[0x16]
constexpr byte setBaudRateCommandData[6]
constexpr byte setDistanceResolution75cmCommandData[6]
OutputControl
Logic level behavior of the auxiliary output pin.
@ NOT_SET
Placeholder for the initial value. Do not use as a config value (it will cause the configuration comm...
DistanceResolution
Distance resolution per gate for detection.
@ RESOLUTION_20CM
Each gate is about 0.20 m, max range about 1.8 m.
@ RESOLUTION_75CM
Each gate is about 0.75 m, max range about 6 m.
LightControl
Light-dependent control status of the auxiliary output.
@ NOT_SET
Placeholder for the initial value. Do not use as a config value (it will cause the configuration comm...