Exported Macros

group Mesh_Access_Exported_Macros

Macro definitions for mesh access layer.

Defines

ACCESS_PAYLOAD_UNSEG_MAX_SIZE 11

Maximum size for unsegmented payload, including opcode. Default value: 11 bytes.

ACCESS_PAYLOAD_SEG_ONE_MAX_SIZE 8

Maximum size for segmented payload (one segment). Default value: 8 bytes.

ACCESS_PAYLOAD_SEG_TWO_MAX_SIZE 20

Maximum size for segmented payload (two segments). Default value: 20 bytes.

ACCESS_PAYLOAD_SEG_THREE_MAX_SIZE 32

Maximum size for segmented payload (three segments). Default value: 32 bytes.

ACCESS_PAYLOAD_MAX_SIZE 380

Maximum size for entire payload (segmented). Default value: 380 bytes.

ACCESS_OPCODE_SIZE(opcode) ((opcode) >= 0xc00000 ? 3 : ((opcode) >= 0x8000 ? 2 : 1))

Determines opcode size (in bytes) based on its value.

ACCESS_OPCODE_BYTE(pbuffer, opcode)

do\

{\

if(

ACCESS_OPCODE_SIZE

(opcode) == 1)\

{\

*((uint8_t *)(pbuffer)) = (opcode) & 0xff;\

}\

else if(

ACCESS_OPCODE_SIZE

(opcode) == 2)\

{\

*((uint8_t *)(pbuffer)) = ((opcode) >> 8) & 0xff;\

*((uint8_t *)(pbuffer) + 1) = (opcode) & 0xff;\

}\

else\

{\

*((uint8_t *)(pbuffer)) = ((opcode) >> 16) & 0xff;\

*((uint8_t *)(pbuffer) + 1) = ((opcode) >> 8) & 0xff;\

*((uint8_t *)(pbuffer) + 2) = (opcode) & 0xff;\

}\

} while(0)


Store opcode into a buffer based on its size.