42 #include "device_state_manager.h" 72 #define ACCESS_HANDLE_INVALID (0xFFFF) 74 #define ACCESS_COMPANY_ID_NONE (0xFFFF) 76 #define ACCESS_COMPANY_ID_NORDIC (0x0059) 79 #define ACCESS_ELEMENT_INDEX_INVALID (0xFFFF) 87 #define ACCESS_OPCODE_SIG(opcode) { (opcode), ACCESS_COMPANY_ID_NONE } 96 #define ACCESS_OPCODE_VENDOR(opcode, company) { (opcode), (company) } 104 #define ACCESS_MODEL_SIG(id) {.company_id = ACCESS_COMPANY_ID_NONE, .model_id = (id)} 113 #define ACCESS_MODEL_VENDOR(id, company) {.company_id = (company), .model_id = (id)} 116 #define ACCESS_TTL_USE_DEFAULT (0xFF) 123 #define ACCESS_MESSAGE_LENGTH_MAX (NRF_MESH_SEG_PAYLOAD_SIZE_MAX) 126 #define ACCESS_PUBLISH_PERIOD_STEP_MAX (0x3F) 129 #define ACCESS_PUBLISH_STEP_RES_BITS (2) 131 #define ACCESS_PUBLISH_STEP_NUM_BITS (6) 133 #define ACCESS_PUBLISH_RETRANSMIT_COUNT_BITS (3) 135 #define ACCESS_PUBLISH_RETRANSMIT_INTERVAL_STEPS_BITS (5) 138 #define ACCESS_PUBLISH_PERIOD_NONE { ACCESS_PUBLISH_RESOLUTION_100MS, 0 } 151 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.
uint32_t access_model_element_index_get(access_model_handle_t handle, uint16_t *p_element_index)
Returns the element index for the model handle.
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.
Model publish retransmit structure.
access_opcode_handler_cb_t handler
The opcode handler callback for the given opcode.
#define ACCESS_PUBLISH_RETRANSMIT_INTERVAL_STEPS_BITS
Publish Retransmit Interval Steps, number of bits.
void access_init(void)
Initializes the access layer.
bool force_segmented
Forces the message to be sent out as a segmented message, if message is shorter than the size require...
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.
uint8_t interval_steps
Publish Retransmit Interval Steps.
nrf_mesh_transmic_size_t transmic_size
Select desired transport MIC size.
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.
nrf_mesh_transmic_size_t
Message MIC size selection.
Access model allocation parameter structure.
#define ACCESS_PUBLISH_RETRANSMIT_COUNT_BITS
Publish Retransmit Count, number of bits.
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).
uint8_t count
Publish Retransmit Count.
Step resolution: 10min / step.