Our website is under construction. Please stay tuned!

dwm_pos_set

Sets a default position of the node. the default position is not used in tag mode but is stored anyway, so the module can be configured to anchor mode using 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 and 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)

  • outputStatus 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 - little endian, is x c oordinate in mi llimeters

int32_t - little endian, is y c oordinate in mi llimeters

int32_t - little endian, is z c oordinate in mi llimeters

uint8_t - | is

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 err_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**

le ngth

** type**

le ngth

v alue

** type**

le ngth

v alue

0x80

0x0C

0x42

0x04

i nt32_t - little e ndian, is x coor dinate in milli meters

0x44

0x04

i nt32_t - little e ndian, is z coor dinate in milli meters

0x4b

x0a

0x00

x00

0x9c

0x0e

x00

0x00

Type 0x80 means command dwm_pos_set_xyz
Type 0x42 means position coordinate x
Type 0x44 means position coordinate z

TLV Response

Type

Length

Value

0x40

0x01

0 Ok
1 Error

0x00