dwm_pos_set
Sets the default position of the node. The default position is not used in tag mode but is stored anyway. This allows the module to be configured in anchor mode and use the value previously set by dwm_pos_set. Normally, this call writes to internal flash when setting a new value. Hence, it should not be used frequently. The response can take hundreds of milliseconds in the worst case!
-
void dwm_pos_set(dwm_pos_t *pos);
- Parameters
pos->x – 32-bit integer (position coordinate in millimeters)
pos->y – 32-bit integer (position coordinate in millimeters)
pos->z – 32-bit integer (position coordinate in millimeters)
output – Status code
C code example 1
dwm_pos_t pos;
pos.qf = 100;
pos.x = 121;
pos.y = 50;
pos.z = 251;
dwm_pos_set(&pos);
SPI/UART example 1
TLV Request |
|||||
---|---|---|---|---|---|
Type |
Length |
Value |
|||
0x01 |
0x0D |
int32_t in little endian - x coordinate in millimeters |
int32_t in little endian - y coordinate in millimeters |
int32_t in little endian - z coordinate in millimeters |
uint8_t - quality factor in percents (0-100) |
0x4b 0x0a 0x00 0x00 0x1f 0x04 0x00 0x00 0x9c 0x0e 0x00 0x00 0x64 |
Type 0x01 means command dwm_pos_set
TLV Response |
||
---|---|---|
Type |
Length |
Value (see error codes) |
0x40 |
0x01 |
0x00 |
Type 0x40 means Status code of the previous command
C code example 2
int32_t x,z;
x = 121;
z = 251;
dwm_pos_set_xyz(&x, NULL, &z);
SPI/UART example 2
TLV Request |
|||||||
---|---|---|---|---|---|---|---|
Type |
Length |
Type |
Length |
Value |
Type |
Length |
Value |
0x80 |
0x0C |
0x42 |
0x04 |
int32_t in little endian - x coordinate in millimeters |
0x44 |
0x04 |
int32_t in little endian - z coordinate in millimeters |
0x4b 0x0a 0x00 0x00 0x1f 0x04 0x00 0x00 |
0x9c 0x0e 0x00 0x00 0x00 0x64 0x00 0x00 |
TLV Response |
||
---|---|---|
Type |
Length |
Value |
0x40 |
0x01 |
0x00 |