Z-Wave Protocol Controller Reference
zwapi_session.h
Go to the documentation of this file.
1/******************************************************************************
2 * # License
3 * <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
4 ******************************************************************************
5 * The licensor of this software is Silicon Laboratories Inc. Your use of this
6 * software is governed by the terms of Silicon Labs Master Software License
7 * Agreement (MSLA) available at
8 * www.silabs.com/about-us/legal/master-software-license-agreement. This
9 * software is distributed to you in Source Code format and is governed by the
10 * sections of the MSLA applicable to Source Code.
11 *
12 *****************************************************************************/
13
20#ifndef ZWAPI_SESSION_H
21#define ZWAPI_SESSION_H
22
23#include <stdbool.h>
24#include "sl_status.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
32#define IDX_LEN 0
33#define IDX_TYPE 1
34#define IDX_CMD 2
35#define IDX_DATA 3
37
40#define FRAME_TYPE_REQUEST 0x00
41#define FRAME_TYPE_RESPONSE 0x01
43
51int zwapi_session_init(const char *serial_port);
52
57
69
70// Previously named SendFrame in the legacy SerialAPI module
83 const uint8_t *payload_buffer,
84 uint8_t payload_buffer_length);
85
105 const uint8_t *payload_buffer,
106 uint8_t payload_buffer_length,
107 uint8_t *response_buf,
108 uint8_t *response_len);
109
122 const uint8_t *payload_buffer,
123 uint8_t payload_buffer_length);
124
132
144bool zwapi_session_dequeue_frame(uint8_t **frame_ptr, uint8_t *frame_len);
145
152
153#ifdef __cplusplus
154}
155#endif
156
157#endif // ZWAPI_SESSION_H
uint32_t sl_status_t
Definition: sl_status.h:139
SL Status Codes.
bool zwapi_session_dequeue_frame(uint8_t **frame_ptr, uint8_t *frame_len)
Get the next frame from the zwapi_session receive queue.
Definition: zwapi_session.c:146
int zwapi_session_restart()
Closes and re-initializes the zwapi_session to the Z-Wave module.
Definition: zwapi_session.c:141
sl_status_t zwapi_session_send_frame(uint8_t command, const uint8_t *payload_buffer, uint8_t payload_buffer_length)
Send data frame to Z-Wave chip via serial port and wait for ACK.
Definition: zwapi_session.c:173
void zwapi_session_shutdown()
Close the zwapi_session with the Z-Wave module.
Definition: zwapi_session.c:135
sl_status_t zwapi_session_send_frame_with_response(uint8_t command, const uint8_t *payload_buffer, uint8_t payload_buffer_length, uint8_t *response_buf, uint8_t *response_len)
Send data frame to Z-Wave chip via serial API, wait for ACK and a RES frame.
Definition: zwapi_session.c:259
int zwapi_session_init(const char *serial_port)
Initialize a zwapi_session with the Z-Wave module.
Definition: zwapi_session.c:130
void zwapi_session_enqueue_rx_frames(void)
Loads the received frames from the serial device into the zwapi_session receive queue.
Definition: zwapi_session.c:165
void zwapi_session_flush_queue(void)
Flush the zwapi_session receive queue.
Definition: zwapi_session.c:336
sl_status_t zwapi_session_send_frame_no_ack(uint8_t command, const uint8_t *payload_buffer, uint8_t payload_buffer_length)
Send data frame to Z-Wave chip via serial API without waiting for ACK.
Definition: zwapi_session.c:320