Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
lwm2m_path.h File Reference

Go to the source code of this file.

Macros

#define LWM2M_PATH(...)
 Generate LwM2M string paths using numeric components. More...
 
#define LWM2M_PATH_VA_NUM_ARGS(...)    LWM2M_PATH_VA_NUM_ARGS_IMPL(__VA_ARGS__, 5, 4, 3, 2, 1)
 
#define LWM2M_PATH_VA_NUM_ARGS_IMPL(_1, _2, _3, _4, N, ...)   N
 
#define LWM2M_PATH1(_x)   #_x
 
#define LWM2M_PATH2(_x, _y)   #_x "/" #_y
 
#define LWM2M_PATH3(_x, _y, _z)   #_x "/" #_y "/" #_z
 
#define LWM2M_PATH4(_a, _x, _y, _z)   #_a "/" #_x "/" #_y "/" #_z
 
#define LWM2M_PATH_MACRO(_1, _2, _3, _4, NAME, ...)   NAME
 

Macro Definition Documentation

◆ LWM2M_PATH

#define LWM2M_PATH (   ...)
Value:
LWM2M_PATH2, LWM2M_PATH1)(__VA_ARGS__)
#define LWM2M_PATH3(_x, _y, _z)
Definition: lwm2m_path.h:39
#define LWM2M_PATH4(_a, _x, _y, _z)
Definition: lwm2m_path.h:40
#define LWM2M_PATH1(_x)
Definition: lwm2m_path.h:37
#define LWM2M_PATH_MACRO(_1, _2, _3, _4, NAME,...)
Definition: lwm2m_path.h:42
#define LWM2M_PATH2(_x, _y)
Definition: lwm2m_path.h:38

Generate LwM2M string paths using numeric components.

Accepts at least one and up to four arguments. Each argument will be stringified by the pre-processor, so calling this with non-literals will likely not do what you want. For example,

 #define MY_OBJ_ID 3
 LWM2M_PATH(MY_OBJ_ID, 0, 1)

would evaluate to "3/0/1", while

int x = 3; LWM2M_PATH(x, 0, 1)

evalutes to "x/0/1".

◆ LWM2M_PATH1

#define LWM2M_PATH1 (   _x)    #_x

◆ LWM2M_PATH2

#define LWM2M_PATH2 (   _x,
  _y 
)    #_x "/" #_y

◆ LWM2M_PATH3

#define LWM2M_PATH3 (   _x,
  _y,
  _z 
)    #_x "/" #_y "/" #_z

◆ LWM2M_PATH4

#define LWM2M_PATH4 (   _a,
  _x,
  _y,
  _z 
)    #_a "/" #_x "/" #_y "/" #_z

◆ LWM2M_PATH_MACRO

#define LWM2M_PATH_MACRO (   _1,
  _2,
  _3,
  _4,
  NAME,
  ... 
)    NAME

◆ LWM2M_PATH_VA_NUM_ARGS

#define LWM2M_PATH_VA_NUM_ARGS (   ...)     LWM2M_PATH_VA_NUM_ARGS_IMPL(__VA_ARGS__, 5, 4, 3, 2, 1)

◆ LWM2M_PATH_VA_NUM_ARGS_IMPL

#define LWM2M_PATH_VA_NUM_ARGS_IMPL (   _1,
  _2,
  _3,
  _4,
  N,
  ... 
)    N