42 #include "device_state_manager.h" 69 #define ACCESS_HANDLE_INVALID (0xFFFF) 71 #define ACCESS_COMPANY_ID_NONE (0xFFFF) 73 #define ACCESS_COMPANY_ID_NORDIC (0x0059) 76 #define ACCESS_ELEMENT_INDEX_INVALID (0xFFFF) 84 #define ACCESS_OPCODE_SIG(opcode) { (opcode), ACCESS_COMPANY_ID_NONE } 93 #define ACCESS_OPCODE_VENDOR(opcode, company) { (opcode), (company) } 101 #define ACCESS_MODEL_SIG(id) { (id), ACCESS_COMPANY_ID_NONE } 110 #define ACCESS_MODEL_VENDOR(id, company) { (id), (company) } 113 #define ACCESS_TTL_USE_DEFAULT (0xFF) 120 #define ACCESS_MESSAGE_LENGTH_MAX (NRF_MESH_SEG_PAYLOAD_SIZE_MAX) 123 #define ACCESS_PUBLISH_PERIOD_STEP_MAX (0x3F) 126 #define ACCESS_PUBLISH_STEP_RES_BITS (2) 128 #define ACCESS_PUBLISH_STEP_NUM_BITS (6) 131 #define ACCESS_PUBLISH_PERIOD_NONE { ACCESS_PUBLISH_RESOLUTION_100MS, 0 } 144 typedef struct __attribute((packed))
Step resolution: 100ms / step.
uint32_t access_model_publish(access_model_handle_t handle, const access_message_tx_t *p_message)
Publishes an access layer message to the publish address of the model.
uint16_t access_model_handle_t
Access layer handle type.
access_opcode_t opcode
Opcode of the message.
uint32_t opcode_count
Number of opcode handles.
uint16_t company_id
Company ID.
const access_opcode_handler_t * p_opcode_handlers
Pointer to list of opcode handler callbacks.
Maximum publish resolution.
void access_clear(void)
Clears the access layer states, and erases the persistent storage copy.
uint8_t step_res
Step resolution.
access_opcode_handler_cb_t handler
The opcode handler callback for the given opcode.
void access_init(void)
Initializes the access layer.
void(* access_publish_timeout_cb_t)(access_model_handle_t handle, void *p_args)
Access layer publish timeout event callback.
access_message_rx_meta_t meta_data
Meta data for the message.
uint16_t dsm_handle_t
DSM handle type, used for the handles returned for the each set of data added.
access_publish_resolution_t
Periodic publishing step resolution.
uint16_t opcode
14-bit or 7-bit Bluetooth SIG defined opcode or 6-bit vendor specific opcode.
uint8_t step_num
Number of steps.
access_publish_timeout_cb_t publish_timeout_cb
Timeout callback called when the publication timer expires.
uint16_t element_index
Element index to add the model to.
#define ACCESS_PUBLISH_STEP_RES_BITS
Publish step resolution, number of bits.
void(* access_opcode_handler_cb_t)(access_model_handle_t handle, const access_message_rx_t *p_message, void *p_args)
Access layer opcode handler callback type.
nrf_mesh_tx_token_t access_token
Token that can be used as a reference in the TX complete callback.
access_model_id_t model_id
SIG or Vendor Model ID.
#define ACCESS_PUBLISH_STEP_NUM_BITS
Publish step number, number of bits.
uint16_t model_id
Model ID.
uint32_t access_model_reply(access_model_handle_t handle, const access_message_rx_t *p_message, const access_message_tx_t *p_reply)
Replies to an access layer message.
const uint8_t * p_buffer
Pointer to the message data.
uint32_t nrf_mesh_tx_token_t
TX Token type, used as a context parameter to notify the application of ended transmissions.
access_opcode_t opcode
The model opcode.
Access layer opcode type.
uint16_t company_id
Company ID.
Step resolution: 10s / step.
Step resolution: 1s / step.
Access layer TX parameter structure.
uint16_t length
Length of the data (excluding the opcode).
uint16_t length
Length of p_data.
Access model allocation parameter structure.
Model publish period structure.
uint32_t access_model_add(const access_model_add_params_t *p_model_params, access_model_handle_t *p_model_handle)
Allocates, initializes and adds a model to the element at the given element index.
void * p_args
Generic argument pointer.
access_opcode_t opcode
Opcode for the message.
Access layer RX event structure.
const uint8_t * p_data
Pointer to the first byte of message data (excludes the opcode).
Step resolution: 10min / step.