wirepas 2.1.0.0
|
Wirepas Click Example. More...
Macros | |
#define | PROCESS_BUFFER_SIZE 300 |
#define | TX_DATA "Wirepas Click" |
#define | MULTI_SINK_MODE |
#define | ROUTER_NODE_ADDRESS 0x01 |
Wirepas node addresses. | |
#define | SINK_1_NODE_ADDRESS 0x02 |
#define | SINK_2_NODE_ADDRESS 0x03 |
#define | NET_ADDRESS 0x01 |
#define | CHANNEL_ADDRESS 0x01 |
#define | NODE_ADDRESS |
Functions | |
err_t | wirepas_wait_response (wirepas_t *ctx, uint8_t primitive_id) |
Wirepas wait response function. | |
err_t | wirepas_parse_frame (wirepas_t *ctx, uint8_t primitive_id) |
Wirepas parse frame function. | |
err_t | wirepas_poll_indication (wirepas_t *ctx) |
Wirepas send poll indication function function. | |
void | application_init (void) |
void | application_task (void) |
int | main (void) |
Variables | |
uint8_t | frame_id = 0 |
uint8_t | stack_auto_start = 1 |
uint8_t | pdu_capacity = 0x10 |
wirepas_sink_data | sink_1 |
wirepas_sink_data | sink_2 |
Wirepas Click Example.
This example demonstrates the use of Wirepas click board by processing the incoming data and displaying them on the USB UART in sink mode, and sending data to the sinks in router mode.
The demo application is composed of two sections :
Initializes the driver and performs the click default configuration, setting device mode, node, net and channel addresses, and starting stack.
Router mode - Sending data to the sinks at the same network. Sink mode - Reads and processes all incoming data and displays them on the USB UART.
#define CHANNEL_ADDRESS 0x01 |
#define MULTI_SINK_MODE |
#define NET_ADDRESS 0x01 |
#define NODE_ADDRESS |
#define PROCESS_BUFFER_SIZE 300 |
#define ROUTER_NODE_ADDRESS 0x01 |
Wirepas node addresses.
Specified setting for node addresses of Wirepas Click driver.
#define SINK_1_NODE_ADDRESS 0x02 |
#define SINK_2_NODE_ADDRESS 0x03 |
#define TX_DATA "Wirepas Click" |
void application_init | ( | void | ) |
< Logger config object.
< Click config object.
Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG
void application_task | ( | void | ) |
int main | ( | void | ) |
err_t wirepas_parse_frame | ( | wirepas_t * | ctx, |
uint8_t | primitive_id ) |
Wirepas parse frame function.
This function is used to parse frame response from the device.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[in] | primitive_id | : Expected Primitive ID. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t wirepas_poll_indication | ( | wirepas_t * | ctx | ) |
Wirepas send poll indication function function.
This function is used to send poll indication, and get response from the device.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[in] | primitive_id | : Expected Primitive ID. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t wirepas_wait_response | ( | wirepas_t * | ctx, |
uint8_t | primitive_id ) |
Wirepas wait response function.
This function is used to get response from the device.
[in] | ctx | : Click context object. See wirepas_t object definition for detailed explanation. |
[in] | primitive_id | : Expected Primitive ID. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. uint8_t frame_id = 0 |
uint8_t pdu_capacity = 0x10 |
wirepas_sink_data sink_1 |
wirepas_sink_data sink_2 |
uint8_t stack_auto_start = 1 |